Results 1 to 2 of 2

Thread: Problem with filters

  1. #1
    Join Date
    Jul 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem with filters

    having a problem with the following, not entirely sure what I've done wrong! it's supposed to add a filter to a picture so that the area around the mouse turns transparent...
    head
    Code:
    <style>
    <!--
    
    #myimage{
    filter:alpha(opacity=20);
    }
    
    -->
    </style>
    Body
    Code:
    <script language="JavaScript1.2">
    
    
    s = 50; // the size of the spotlight
    vp = 10; // the visibility percent of the picture
    startx = 0; // the top position of your sportlight into the image (on start)
    starty = 0; // the left position of your spotlight into the image (on start)
    
    
    
    var IE = document.all?true:false
    
    function moveL()
    {
    xv = tempX;
    yv = tempY;
    myimage.filters.alpha.opacity<100;
    }
    
    if (IE&&myimage.filters)
    document.all.myimage.onmousemove = getMouseXY;
    var tempX = 0
    var tempY = 0
    
    
    function getMouseXY(e) {
    tempX = event.offsetX
    tempY = event.offsetY
    
      if (tempX < 0){tempX = 0}
      if (tempY < 0){tempY = 0}
      if (t)
      {  
       moveL();
      }
    
      return true
    }
    
    var xv = startx;
    var yv = starty;
    var t= true;
    if (IE&&myimage.filters){
    myimage.filters.alpha.opacity<100
    myimage.filters.alpha.addPoint(startx,starty,s,255,255,255,255)
    }
    
    </script>
    if anyone can offer any assistance it would be much appreciated

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    To start with:
    filter: is IE-only. This is bad. More detail on CSS opacity can be found here. You should adjust the script.

    The language= attribute is deprecated. Use type="text/javascript".

    I'm afraid I can't help you further, because I don't have IE.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •