SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Are There Problems............

    Sorry to put in again (its in another thread.).....
    This works better than my present mouse-position finder;
    Code:
    Click empty pic for x,y alert<br>
    <img src="emptypic.gif" width=250 height=250 border=1 usemap="#findmouse">
    <map name="findmouse">
    <script>
    function showmouse(x,y) { alert(x+','+y) }
    for (i=0;i<250;i+=5) {
    for (j=0;j<250;j+=5) {
    document.write('<area shape="rect" coords="'+i+','+j+','+(i+5)+','+(j+5)+'" href="javascript:showmouse('+i+','+j+')">')
    }}
    </script>
    </map>
    Can anybody see if there would be comlications implementing this program?? (cross browser)

    As there are so many area shapes, would this affect the rest of the document online??
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why the image map, and not get the pageX, pageY values?
    http://www.xs4all.nl/~ppk/js/events_compinfo.html
    (Bottom of page; "What was the mouse position during the event?")

  3. #3
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Thanks jofa. nice!

    Yeah, I already use it but didn't realize its cross browser capabilities. The one I use was a script I found on the web ages ago, but it includes a cross browser function as well.
    Thanks for the pointer.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


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
  •