Javascript on Mozilla?

J

John Smith

Can you tell me why Mozilla can't show some Javascript?
example:

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=100
}

function highlightit(cur2){
if (cur2.style.MozOpacity>0.4)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)-0.1
else if (cur2.filters&&cur2.filters.alpha.opacity>50)
cur2.filters.alpha.opacity-=10
else if (window.highlighting)
clearInterval(highlighting)
}



<a href="something.php"><img src="something.jpg" width="129"
height="150" border="0"
style="filter:alpha(opacity=100);-moz-opacity:0.3"
onMouseOver="high(this)" onMouseOut="low(this)"></a>


sorry on my english, I hope you understand the question.
 
M

Martin Honnen

John said:
Can you tell me why Mozilla can't show some Javascript?

Have you checked the Mozilla JavaScript console? Does it display any errors?
What do you want the script to do?
example:

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=100
}

function highlightit(cur2){
if (cur2.style.MozOpacity>0.4)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)-0.1
else if (cur2.filters&&cur2.filters.alpha.opacity>50)
cur2.filters.alpha.opacity-=10
else if (window.highlighting)
clearInterval(highlighting)
}



<a href="something.php"><img src="something.jpg" width="129"
height="150" border="0"
style="filter:alpha(opacity=100);-moz-opacity:0.3"
onMouseOver="high(this)" onMouseOut="low(this)"></a>

The static CSS setting of -moz-opacity is 0.3, then you check
if (cur2.style.MozOpacity>0.4)
which is not the case thus nothing happens. Perhaps you want to start with
-moz-opacity: 1;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top