Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code for rollovers

Status
Not open for further replies.

rebeccam

Programmer
May 21, 2002
20
CA
Does anyone know the code for a rollover that opens up a sized window.
For example: width=700,height=470,tollbar=yes,menubar=yes'
Thanks

 
Hi,

No offence, are you really sure you want a MouseOver script doing it? I only ask, cos everytime u move the mouse over the button, its going to open up a brand new window, which in my opinion, would drive me nuts.

Otherwise, yes i do.

James
 
Well perhaps onClick would be better than MouseOver.
Do you know the code?
 
Hi,

Use this:
////////////////////////////////////////////////
<HTML>
<HEAD>
<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot;>
img1on = new Image(); // Active images
img1on.src = &quot;pic1on.gif&quot;;
img2on = new Image();
img2on.src = &quot;pic2on.gif&quot;;


img1off = new Image(); // Inactive images
img1off.src = &quot;pic1off.gif&quot;;
img2off = new Image();
img2off.src = &quot;pic2off.gif&quot;;

function imgOn(imgName) {
if (document.images) {
document
.src = eval(imgName + &quot;on.src&quot;);
}
}


function imgOff(imgName) {
if (document.images) {
document
.src = eval(imgName + &quot;off.src&quot;);
}
}

</SCRIPT>
<SCRIPT>
function popUpWindow()
{
window.open('crazy error.html','Alert','toolbar=yes,location=no,directories=no,status=no,' + 'menubar=no,scrollbars=no,resizable=no,' + 'width=700,height=470,screenX=0,screenY=0');
}
</SCRIPT>
</HEAD>
<BODY>
<A HREF=&quot;javascript:popUpWindow()&quot; onMouseOver = &quot;imgOn('img1')&quot;onMouseOut = &quot;imgOff('img1')&quot;><IMG NAME=&quot;img1&quot; SRC=&quot;pic1off.gif&quot;></A>
</BODY>
</HTML>
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
You will need to add more pics as you need them to the first part of the script (the pre-loader) and then in the <A> tag's make sure to have the mouseovers showing the proper name and the <IMG> tag's must have the correct NAME=&quot;&quot; according to your picture. Only .gif's seem to work with this.

Hope this helps! NATE
spyderix.gif

design@spyderix-designz.com
 
rebeccam
wanted to let you know i also gave another example in the web designers forum.

I help at your own risk, if I brake it sorry! But if I fixed it, let me know with a
star.gif
[thumbsup2]
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top