PDA

View Full Version : Rollover headache!!


papaloi
10-06-2005, 11:25 PM
Hi Guys,

Am I glad I found you! I've been trying to create a simple rollover button on my site using Dreamweaver MX. Did the 'insert-interactive-rollover-etc, etc' but when I preview it in IE nothing changes?

I've tried everything I can think of but still no luck?? :angry:

Help!!!!! :blink:

Creative Insanity
10-07-2005, 12:01 AM
1. Create your 2 images (on and off images) for the roll over and make sure they are the same sizes (or it will look horrid).
2. Open up DW and load the page you want the rollover on.
3. In DW go Insert -> Image Objects -> RollOver Image
4. Name the rollover (good practise to get into) and fill in the original (off) and rollover (on) images, and name the page or URL they are to go to.
5. Save and press F12 to preview.

papaloi
10-07-2005, 03:27 AM
Thanks....but thats the problem. I've done that and the rollover still does not appear to work?

It baffles me :blink:

domedia
10-07-2005, 03:49 AM
Are your images within the defined site in DW?

If they are, paste your code here so we can see why this is happening.

Creative Insanity
10-07-2005, 06:48 AM
yeah make sure that the images are in the sites image directory and not in some other folder like my documents.

papaloi
10-07-2005, 01:41 PM
I think this is what you mean? I'm new and not very good with codes...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>about</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
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=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

Any use? :unsure:

domedia
10-07-2005, 04:13 PM
Are your images within the defined site in DW?
..

papaloi
10-07-2005, 04:27 PM
Yep!

domedia
10-07-2005, 05:11 PM
ah in that case paste the *whole* html document in here :)

papaloi
10-07-2005, 11:06 PM
Here it is folks!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>about</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
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=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body background="ss_masquerade.jpg" text="#00FF00" onLoad="MM_preloadImages('HOME.jpg')">
<span id="Layer1" style="position:absolute; visibility:visible; width:775px; height:115px; z-index:1; left: 3px; top: 79px;">
<div align="center"><span id="Layer18" style="position:absolute; visibility:visible; width:92px; height:55px; z-index:23; left: 348px; top: 1550px;">
<div align="right">BACK.jpg (about.htm)</div>
</span>gagmeisterbanner.jpg</div>
</span> <span id="Layer2" style="position:absolute; visibility:visible; width:773px; height:52px; z-index:2; top: 238px; left: 2px;">
<div align="center">ABOUT.jpg</div>
</span> <span id="Layer17" style="position:absolute; visibility:visible; width:100px; height:49px; z-index:27; left: 51px; top: 563px;">
<div align="center">SAMPLES.jpg (samples2.htm)</div>
</span> <span id="Layer21" style="position:absolute; visibility:visible; width:596px; height:13px; z-index:30; left: 155px; top: 562px;">
<div align="center">purplebar8.gif</div>
</span>
<span id="Layer22" style="position:absolute; visibility:visible; width:600px; height:16px; z-index:31; left: 151px; top: 842px;">
<div align="center">purplebar8.gif</div>
</span> <span id="Layer23" style="position:absolute; visibility:visible; width:599px; height:17px; z-index:32; left: 149px; top: 1069px;">
<div align="center">purplebar8.gif</div>
</span> <span id="Layer24" style="position:absolute; visibility:visible; width:597px; height:17px; z-index:33; left: 151px; top: 1328px;">
<div align="center">purplebar8.gif</div>
</span> <span id="Layer12" style="position:absolute; visibility:visible; width:96px; height:49px; z-index:35; left: 54px; top: 615px;">
<div align="center">NEWS.jpg (news.htm)</div>
</span>
<div align="center"></div>
<span id="Layer3" style="position:absolute; visibility:visible; width:97px; height:54px; z-index:3; left: 51px; top: 301px;">
<div align="center">1208.gif (home.htm)</div>
</span> <span id="Layer4" style="position:absolute; visibility:visible; width:101px; height:55px; z-index:4; left: 50px; top: 353px;">
<div align="center">ABOUT.jpg (aboutus.htm)</div>
</span> <span id="Layer7" style="position:absolute; visibility:visible; width:103px; height:53px; z-index:7; left: 48px; top: 406px;">
<div align="center">SERVICES.jpg (services.htm)</div>
</span> <span id="Layer9" style="position:absolute; visibility:visible; width:101px; height:53px; z-index:9; left: 51px; top: 458px;">
<div align="center">CONTACT.jpg (contact.htm)</div>
</span> <span id="Layer11" style="position:absolute; visibility:visible; width:103px; height:52px; z-index:11; left: 49px; top: 510px;">
<div align="center">LINKS.jpg (links.htm)</div>
</span> <span id="Layer8" style="position:absolute; visibility:visible; width:548px; height:115px; z-index:22; left: 178px; top: 320px;">
<font color="#8080FF" size="4" face="Showcard Gothic">WILL</font> <font color="#00FF40" size="4" face="SF Cartoonist Hand">is
the old 'un (but not by much he says!!) Will started life as a foetus and as soon
as he learned to walk, trod the boards as a 'stand up' comedian. At one point
he seriously considered opening a greengrocers with everything that had been thrown
at him, but instead he took to writing for others working on hit shows such as
The News Huddlines, Dead Ringers, The Treason Show and NewsRevue, officially The
World's Longest Running Live Comedy Show (Guinness Book of Records) In his spare
time, he likes to make model airplanes from the fluff in his navel and devise
different way’s to cure world hunger.....we suggested he should stop eating
all the pies!</font></span> <span id="Layer10" style="position:absolute; visibility:visible; width:548px; height:115px; z-index:23; left: 176px; top: 601px;"><font color="#8080FF" size="4" face="Showcard Gothic">HANDLEY</font>.
<font size="4" face="SF Cartoonist Hand">Brilliant, comic genius, devilishly good
looking! Only a few things that have been said about other comics, Handley; a
one time professional boil sucker, writes and performs his own material and has
come along way from those dark days of solitary confinement in Broadmoor, where
he was held for murdering some really good gags. It was here that his writing
really showed promise as he wrote for 'Have I Got News For You, The News Huddlines
and Shoot The Writers. In his spare time Handley likes to pull the legs off of
spiders, taking them into various bakery’s where he tries to exchange them
for currants.</font></span> <span id="Layer13" style="position:absolute; visibility:visible; width:548px; height:115px; z-index:24; left: 176px; top: 875px;"><font color="#8080FF" size="4" face="Showcard Gothic">J.J.
</font><font color="#00FF00" size="4" face="SF Cartoonist Hand">Without doubt
a talented comedy writer, as was proven by the Inland Revenue after reading her
tax return! Was shoved into writing after the fickle hand of fate; made her and
several of her colleagues redundant from 'Airport FM' a little known radio station
that never really got off the ground, but their loss is our gain as she brought
most of the equipment away with her. In her spare time, she likes nothing more
than ringing doorbells and running away as well as fishing for compliments.</font></span>
<span id="Layer15" style="position:absolute; visibility:visible; width:550px; height:115px; z-index:25; left: 176px; top: 1109px;"><font color="#8080FF" size="4" face="Showcard Gothic">JOHN</font>
<font color="#00FF00" size="4" face="SF Cartoonist Hand">is best be described
as the 'Salvador Dali' of our crew, in other words...he's not well. A man of whom
it was once said "Please don't approach this man, he may be dangerous."
John is a pussy cat...last week he was a gerbil and next week he plans to be a
duck, so he is in character to write his first serious piece "Drake, the
man behind the bowls." A man of mystery to many, including the police, the
D.H.S.S. and his Aunt Ethel who never really understood him anyway. In his spare
time he likes to bounce off the walls and ride the pink elephants that inhabit
his padded cell. </font></span> <span id="Layer20" style="position:absolute; visibility:visible; width:550px; height:230px; z-index:29; left: 175px; top: 1365px;">


<font color="#8080FF" size="4" face="Showcard Gothic">JON <font color="#00FF40" face="SF Cartoonist Hand">The
newest member of our team tells us he gets a plethora of ideas whilst in the
tub, we've told him to stop that habit as it leads to blindness and hairy hands!
Jon has the perfect face for radio as proved by his work on shows such as BBC
Radio Five Live's 'Keep Taking the Nandrolone' and 'Roundabout'</font> <font color="#00FF40" size="4" face="SF Cartoonist Hand">made
by Radio Wales</font><font color="#00FF40" face="SF Cartoonist Hand">. He has
shown considerable promise working on shows such as 'Shoot the Writers' on TV
and 'Roughcuts' on stage where he found the 'Principal Boy' wasn't a boy and
had no principals either. </font></font><font color="#8080FF" size="4" face="Showcard Gothic"><font color="#00FF40" face="SF Cartoonist Hand">In
his spare time he likes to do bird impressions by eating worms and crapping
on peoples washing.

</font></font></p>
</span>
</body>
</html>

Now I'm confused even more...It don't take a lot :blink:

Creative Insanity
10-07-2005, 11:17 PM
I can't see where your image swap is?
There should be something that looks like this:

<a href="#" onMouseOut="swapImgRestore()" onMouseOver="swapImage('rollover','','../images/b04.gif',1)"><img src="../images/b02.gif" name="rollover" width="95" height="42" border="0"></a>

Darn posted too fast.. hehe just saw it.

Hmm.. is this online.. just want to see if it is your system or not.. looks fine to me.

mrchrisharan
10-08-2005, 02:05 AM
I've just tried it for the first time and had no problems at all!

papaloi
10-08-2005, 02:08 AM
Blimey! What browser did you preview it on? I take it you just pasted it into DW and bob's your uncle! I mean you didn't upload onto a site as such?

papaloi
10-08-2005, 02:21 AM
Well its baffled me! I did it all as you've all said F12 and all that...nothing!
Upload it to my site and.......BINGO! IT WORKS!! :D

Thanks for all your advice and help guys.. Nice one! :D