samwangsi
12-22-2003, 09:09 PM
Hello folks, I have some problems with my HP, but the worst is this, I would know how to load a fadeimage script from some .js file and make it work, I will explain this all:
I get the complete script on fadeimage.js:
<script language=javascript>
<!--
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=30
}
function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}
//-->
</script>
then on the page, I have to put these two function to work (--->>>):
<a href="page.htm">
<img --->>>onmouseover=high(this)<<<--- style="FILTER: alpha opacity=70); moz-opacity: 0.3" --->>>onmouseout=low(this)<<<--- border="0" src="image.gif" width="56" height="55"></a>
When I put the script directly on the page, this fade effect works perfectly, so I decided to put it into fadeimage.js for maybe make some modification further...
I tried many script to get it loaded, like src and link and document.write(), but nothing, someone please help me to find out how can I load this .js file sucessfully...
I am no expert in these kind of stuff, then make sure to explain every step... :p :p
I get the complete script on fadeimage.js:
<script language=javascript>
<!--
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=30
}
function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}
//-->
</script>
then on the page, I have to put these two function to work (--->>>):
<a href="page.htm">
<img --->>>onmouseover=high(this)<<<--- style="FILTER: alpha opacity=70); moz-opacity: 0.3" --->>>onmouseout=low(this)<<<--- border="0" src="image.gif" width="56" height="55"></a>
When I put the script directly on the page, this fade effect works perfectly, so I decided to put it into fadeimage.js for maybe make some modification further...
I tried many script to get it loaded, like src and link and document.write(), but nothing, someone please help me to find out how can I load this .js file sucessfully...
I am no expert in these kind of stuff, then make sure to explain every step... :p :p