Web Analytics Made Easy -
StatCounter javascript quandry...interface bug - CodingForum

Announcement

Collapse
No announcement yet.

javascript quandry...interface bug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • javascript quandry...interface bug

    hi all,
    i'm writing a little javascript experiment (i do this often). the mouseover behavior is fine, and is exactly how i want it to work, however, the mouseout one is giving me trouble. i used the exact same code for both, just changing things to make them work opposite of each other (or so i thought). so just have a look, let me know if you see any glaring issues (other than semantics or formatting).

    Thanks,

    Eric

    Edit [for clarity's sake]: The mouseover is supposed to make the button's frame fly out and surround the text, the mouseout is supposed to make it shrink back into a 4 pixel x 4 pixel square
    Attached Files
    Last edited by batman_jones; Feb 14, 2004, 08:16 PM.

  • #2
    you forget exit function,hehe

    you forget exit function,hehe

    function t(k){
    var a=document.getElementById(k).offsetWidth;
    var b=document.getElementById(k).offsetHeight;
    if (a<wmax) {a++;document.getElementById(k).style.width=a+'px';}
    if (b<hmax) {b++;document.getElementById(k).style.height=b+'px';}

    if(a==wmax && b==hmax){
    //alert(a+" "+b)
    return;
    }
    setTimeout("t('"+k+"')",10);
    }

    function z(l){
    var c=document.getElementById(l).offsetWidth;
    var d=document.getElementById(l).offsetHeight;
    if (c>wmin) {c--;document.getElementById(l).style.width=c+'px';}
    if (d>hmin) {d--;document.getElementById(l).style.height=d+'px';}
    if(c==wmin && d==hmin){
    //alert(c+" "+d);
    return;
    }
    setTimeout("z('"+l+"')",10);
    }

    Comment


    • #3
      wow, works like a charm. thanks!

      Comment

      Working...
      X