SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Zealot redeyes's Avatar
    Join Date
    Dec 2001
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why use this 'onmousedown' event?

    I was just browsing the code of a site I am soon to be redoing.. which is something I often do just to see the standard of the previous designer/programmer.

    Code:
    onMouseDown="MM_goToURL('parent','thepage.htm');return document.MM_returnValue">
    Can anyone tell me what the purpose of using 'onmousedown' to move to another page is?.. or was the guy just getting carried away with the behaviours in Dreamweaver...

  2. #2
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Depends, what was in the href attribute? Chances are though, he was being an idiot or even didn't know how to code in the first place.

  3. #3
    SitePoint Member
    Join Date
    Nov 2002
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What element is the onmousedown in ?

    Anyway i expect what Packman says is exactly right

    vibes

  4. #4
    SitePoint Zealot redeyes's Avatar
    Join Date
    Dec 2001
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, little more info:

    Code:
    <a href="#" onMouseOut="MM_swapImgRestore()"
    onMouseOver="MM_swapImage('theimage','','path_to_image',1)">
    <img src="path_to_image" width="122" height="34" border="0"
    name="theimage" onMouseDown="MM_goToURL('parent','the_doc_url');
    return document.MM_returnValue"></a>
    The 'href' sometimes has the actual document path in it aswell.. there is no consistency.

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The onMouseDown is an event that happens when your user clicks "down" on their mouse button. onMouseUp is probably a better event to use, as it will greatly reduce the number of accidental clicks your users will make.

    --Vinnie

  6. #6
    SitePoint Zealot redeyes's Avatar
    Join Date
    Dec 2001
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I realise 'what' it does.. I am curious as to 'why' it is used in this context. I really don't see any need, but I just wanted to ask around as you can never know too much in this industry.


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
  •