[advanced search]
Results from the most recent live auction are here.
23 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Domain Name Industry Newsletter
Go Back   NamePros.Com > Design and Development > Graphic Design / Flash
User Name
Password

Old 08-10-2003, 10:07 AM   · #1
mark4man
NamePros Member
 
Trader Rating: (0)
Join Date: Aug 2003
Posts: 41
NP$: 81.00 (Donate)
mark4man is an unknown quantity at this point
Behavior (or Script) for Visited Link Graphic?

Using Dreamweaver MX for web construction & Photoshop 6.0 for graphics.

I've learned how to create swap image behaviors, where a 2nd image is swapped with the 1st on mouse over.

What I want to do now is assign the 1st image as a link (to another page in my site); & have the 2nd image display (swap) when the link is selected; & remain displayed ...

...in the same way that a simple text hyperlink is displayed as one color, turns a 2nd color on mouse over; & then stays that color when the link is selected (which I believe is referred to as Link & Visited Link.)

Can the same function be created with image files? Is there a Behavior or Script I have missed?

Thanks in advance,

mark4man


Please register or log-in into NamePros to hide ads
mark4man is offline   Reply With Quote
Old 08-13-2003, 06:17 PM   · #2
Fallout_Multi.
www.falloutweb.com
 
Trader Rating: (0)
Join Date: Jun 2003
Posts: 105
NP$: 171.00 (Donate)
Fallout_Multi. is an unknown quantity at this point
since ur using a program, im not sure, but do it manually and just dont have an onMouseOut
Fallout_Multi. is offline   Reply With Quote
Old 08-14-2003, 06:48 AM   · #3
Mp)Tarh
....what?
 
Mp)Tarh's Avatar
 
Location: Ontario, Canada
Trader Rating: (0)
Join Date: Aug 2003
Posts: 101
NP$: 171.00 (Donate)
Mp)Tarh is an unknown quantity at this point
To do this you will need to manually edit the source code of your webpage. You must support JavaScript and have some validation or be sure all your clients support JavaScript.

Here is the code, change the text in Green to whatever you want:


<SCRIPT LANGUAGE="JavaScript">
<!--
var image1;
var image2;

image1 =
1.gif;
image2 =
2.gif;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function changetheimage()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (window.document.changemeimage.src == image1)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.document.changeme image.src = image2;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.document.changemeimage.s rc = image2;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
//-->
</SCRIPT>
<A HREF="
yourpage.htm"><IMG SRC="1.gif" onMouseOver="changetheimage()" onMouseOut="changetheimage()" NAME="changemeimage"></a>



Just copy and paste that directly over the HTML and everything that you use for your hyperlink. I havn't tested this, but it is basic enough that it should work correctly.

All you have to do is change the text in green into your information (I.E. If your image was named "mine.gif" you would change "1.gif" into "mine.gif" ect.).

Happy Programming!
__________________
Yeah... I knew that. What?
Mp)Tarh is offline   Reply With Quote
Old 08-14-2003, 08:28 PM   · #4
mark4man
NamePros Member
 
Trader Rating: (0)
Join Date: Aug 2003
Posts: 41
NP$: 81.00 (Donate)
mark4man is an unknown quantity at this point
Mp)Tarh

Thanks...I'll try it.

mark4man
mark4man is offline   Reply With Quote
Old 08-14-2003, 09:47 PM   · #5
Brak
New Member
 
Trader Rating: (0)
Join Date: Aug 2003
Posts: 14
NP$: 21.00 (Donate)
Brak is an unknown quantity at this point
Actually that way will only work for the time they use the page. You'll need to deal with cookies to make this work. I don't know how javascript deals with cookies, but if you wanted to do it with PHP you'd do something like:

PHP Code:
<?
if($_COOKIE['image'] == TRUE)  $image="image.jpg"; else $image="image-visited.jpg";

setcookie ("image", "1",time()+9999999999999;
?>
<img src="images/<?=$image?>">
__________________
Design | Game | Music
Brak is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
EscrowDNS Arcade Script EscrowDNS
Advertise your business at NamePros
All times are GMT -7. The time now is 05:01 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0