SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2002
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Zoom only works with alert in function ??

    The following only works (IE only) with the alert somewhere in the function. Remove the alert and the window closes... Anybody know what causes this or what's wrong here?

    Code:
    <a href="" onmouseup="zoom();return false;"><img src="picture.jpg" name="picture"></a>
    
    function zoom(){
    alert(event.button);
      if(event.button==1){
        if(window.document.picture.style.zoom!=0) window.document.picture.style.zoom*=1.2;
        else window.document.picture.style.zoom=1.2;
      }
    }

    edit: forgot: I'm using onmouseup because I have 'zoom out' on the right mouse button in the actual script, but it doesn't matter, using only this part gives the same problem.
    The following does work btw.:

    Code:
    <a href="" onclick="zoom();return false;"><img src="picture.jpg" name="picture"></a>
    
    function zoom(){
      if(window.document.picture.style.zoom!=0) window.document.picture.style.zoom*=1.2;
      else window.document.picture.style.zoom=1.2;
    }
    Last edited by Guest; Aug 7, 2002 at 22:28.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •