Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > creating a rollover image from a link

creating a rollover image from a link
Thread Tools
Mac Elite
Join Date: Oct 2001
Location: in a weapons producing nation under Jesus
Status: Offline
Reply With Quote
Jul 21, 2003, 08:18 AM
 
Dont know if anyone can walk me through this cause I know next to nothing about web developemnt, but here goes.

from this site http://www.hillbillywinos.com/WInos%...Bandphotos.htm
I want to put several rollover images that pop up on the main image when the cursor is slid over the names. like when you touch me, Kent Arnsbarger, my picture will replace the one at the top, and so on.

I got the rollover image to work when you touch the PICTURE, but thats it. Again, if you look at the site, you'll understand that I know next to nothing about Dreamweaver so be gentle. I really need about a 1/2 hour with someone who knows what they are doing!!!!

thanks
kent
     
Registered User
Join Date: Jul 2003
Location: San Jose
Status: Offline
Reply With Quote
Jul 21, 2003, 01:48 PM
 
not sure what version of dreamweaver you're using, but if you go 'behaviors > swap image' you come up with....
     
Registered User
Join Date: Jul 2003
Location: San Jose
Status: Offline
Reply With Quote
Jul 21, 2003, 01:50 PM
 
[html]

[head]

[script language="JavaScript" type="text/JavaScript"]
[!--

function swapImgRestore() {
var i,x,a=document.sr; for(i=0;a&&i[a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))]0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i[d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i[d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() {
var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i[(a.length-2);i+=3)
if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//--]
[/script]

[/head]

[body]

[img src="Original_Image.gif" name="Image"]
[a href="Some_Page.htm" onMouseOver="swapImage('Image','','Image_To_Swap.g if',1)" onMouseOut="swapImgRestore()"]Your Link[/a]

[/body]

[/html]
     
Registered User
Join Date: Jul 2003
Location: San Jose
Status: Offline
Reply With Quote
Jul 21, 2003, 01:53 PM
 
make sure that you add the name= attribute to your [img] tag. this is what you'll use in your [a] tags to tell it to swap with that specific image....

hope it helps...
     
Mac Elite
Join Date: Oct 2001
Location: in a weapons producing nation under Jesus
Status: Offline
Reply With Quote
Jul 21, 2003, 02:48 PM
 
hi, wow thanks man, I will look all this over. I'm using Dreamweaver of OSX if that helps at all.

I need a class
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:12 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2