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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouseover help ??

Status
Not open for further replies.

zumie

Technical User
Mar 13, 2002
73
US
I'm trying to write a mouseover effect that
1)Changes the grafic of the button
2)Changes the text of the button (red to blue) (position supplied by CSS).
3)Changes a graphic at the bottom of the page
4)Changes the text at bottom of page (red to blue) (position supplied by CSS).

Everything is working except when I run the cursor over the button all the effects blink. It isn't a solid on/off effect. What am I doing wrong ? Pleeeeze.

Java: ==================
function byt(place, imgName) {
if (Browser == true) {
document[place].src =eval(imgName + ".src");}
} }

var ie = document.all ? 1 : 0;
var ns = document.layers ? 1 : 0;

function slider(name,name1,name2,name3){
if (document.all) {slider_gfx=document.all.slider.style} else {slider_gfx=document.slider}
slider_gfx.left= -200;
if (ie){
document.all[name3].style.visibility = "visible";
document.all[name2].style.visibility = "visible";
document.all[name1].style.visibility = "visible";
document.all[name].style.visibility = "visible";}
else if (ns)
document.layers[name].visibility = "show";
}
function sliderout(name,name1,name2,name3){
if (document.all) {slider_gfx=document.all.slider.style} else {slider_gfx=document.slider}
slider_gfx.left= -40;
if (ie){
document.all[name3].style.visibility = "hidden";
document.all[name2].style.visibility = "hidden";
document.all[name1].style.visibility = "hidden";
document.all[name].style.visibility = "hidden";}
else if (ns)
document.layers[name].visibility = "hide";
}

CSS ====================
#text1 {position:absolute; left:149; top:425; visibility:hidden;}
#text1a {position:absolute; left:149; top:425; visibility:hidden;}
#text1b {position:absolute; left:35; top:259; visibility:hidden;}
#text1c {position:absolute; left:35; top:259; visibility:hidden;}

HTML ====================
<div id=&quot;Button01&quot; style=&quot;width: 140; height: 33&quot;> <a href=&quot;#&quot; onMouseOut=&quot;sliderout('text1','text1a','text1b','text1c');byt('Button1','BUTTON1a')&quot; onMouseOver=&quot;slider('text1','text1a','text1b','text1c');byt('Button1','BUTTON1b')&quot; onFocus=&quot;if(this.blur)this.blur()&quot;>
<img border=&quot;0&quot; name=&quot;Button1&quot; src=&quot;button1_off.gif&quot; width=&quot;216&quot; height=&quot;33&quot;></a>
</div>

Thanks for any advice with this. MSB [peace]



Visualize whorld peas.
 
OK, I'm still learning js and the error (I think) is in the JAVA:

Error message:

'document.all[...].style' is null or not an object.

I'm trying to find out why.

MSB [peace]



Visualize whorld peas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top