Javascript on Mozilla?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Smith

    Javascript on Mozilla?

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

    function high(which2){
    theobject=which 2
    highlighting=se tInterval("high lightit(theobje ct)",50)
    }
    function low(which2){
    clearInterval(h ighlighting)
    if (which2.style.M ozOpacity)
    which2.style.Mo zOpacity=0.3
    else if (which2.filters )
    which2.filters. alpha.opacity=1 00
    }

    function highlightit(cur 2){
    if (cur2.style.Moz Opacity>0.4)
    cur2.style.MozO pacity=parseFlo at(cur2.style.M ozOpacity)-0.1
    else if (cur2.filters&& cur2.filters.al pha.opacity>50)
    cur2.filters.al pha.opacity-=10
    else if (window.highlig hting)
    clearInterval(h ighlighting)
    }



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


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

  • Martin Honnen

    #2
    Re: Javascript on Mozilla?



    John Smith wrote:[color=blue]
    > Can you tell me why Mozilla can't show some Javascript?[/color]

    Have you checked the Mozilla JavaScript console? Does it display any errors?
    What do you want the script to do?
    [color=blue]
    > example:
    >
    > function high(which2){
    > theobject=which 2
    > highlighting=se tInterval("high lightit(theobje ct)",50)
    > }
    > function low(which2){
    > clearInterval(h ighlighting)
    > if (which2.style.M ozOpacity)
    > which2.style.Mo zOpacity=0.3
    > else if (which2.filters )
    > which2.filters. alpha.opacity=1 00
    > }
    >
    > function highlightit(cur 2){
    > if (cur2.style.Moz Opacity>0.4)
    > cur2.style.MozO pacity=parseFlo at(cur2.style.M ozOpacity)-0.1
    > else if (cur2.filters&& cur2.filters.al pha.opacity>50)
    > cur2.filters.al pha.opacity-=10
    > else if (window.highlig hting)
    > clearInterval(h ighlighting)
    > }
    >
    >
    >
    > <a href="something .php"><img src="something. jpg" width="129"
    > height="150" border="0"
    > style="filter:a lpha(opacity=10 0);-moz-opacity:0.3"
    > onMouseOver="hi gh(this)" onMouseOut="low (this)"></a>[/color]

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

    --

    Martin Honnen

    Comment

    Working...