SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Nov 2008
    Location
    Thailand
    Posts
    308
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    handler management

    Brains have seized up.

    I'm looking into various handler management solutions.

    An example, albeit an old one, would be Dean Edwards: addEvent() – My Solution

    Trying to think of a scenario where you might want to have multiple handlers and events assigned to an element?

    If anyone could give me an example scenario it would be appreciated.

    Thanks

    RLM

  2. #2
    SitePoint Addict bronze trophy AllanP's Avatar
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    298
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    How about a click, a mouseover, a mouseout and a double click - all on the same element.

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,712
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by AllanP View Post
    How about a click, a mouseover, a mouseout and a double click - all on the same element.
    That can still be done though without requiring advanced handler techniques.
    Where advanced handler techniques are required is when the same event (such as click) is applied by multiple scripts to the same element.

    As an example, you might have the click event on a tabbed link change the background color of that tab.
    A completely separate script might also show a contents section when you click on that same tab.

    One event will replace the other, unless advanced handler techniques are used.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •