SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast Mr.Alexander's Avatar
    Join Date
    Apr 2010
    Location
    Toronto, Canada
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    (jQuery) mouseover event triggered twice

    Hello,

    I have a drop down menu I use and it works well every time i use it. However, on 1 site, i notice it acts extremely strange.

    I have attached an isolated example of this dropdown.

    When I mouse over the parent of ul.dropdown-menu the drop down is actually displayed but disappears extremely fast after it, even though, my mouse is till on the elements. I tried several experiments and I tried to isolate the drop down to its own file and it actually works beautifully. I tried re-implementing the same script back to the site and disable all other javascript files but the same problem still takes place.

    I would like to mention also, that the problem arises when I include the following line:
    Code JavaScript:
    $('li:has(ul.dropdown-menu)').bind('mouseout',  DropDownMenu_timer);

    I would highly appreciate it if someone could let me know what could be causing this, whether its the context stacking order or event being fired twice.

    Kind Regards,

    Mr. Alexander
    Attached Files Attached Files

  2. #2
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,023
    Mentioned
    210 Post(s)
    Tagged
    1 Thread(s)
    Have you tried to change the value in the timeout variable? I assume that you've done it because it seems that everything is based on it.

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about using one() instead of bind? Or I have done for something like that with mouseenter and mouseleave events on the LI.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Enthusiast Mr.Alexander's Avatar
    Join Date
    Apr 2010
    Location
    Toronto, Canada
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Guys,

    I am really sorry that i bothered you and i feel like an idiot.

    After MANY hours spent on this it turns out that.... drum roll... i included the javascript file twice....

    thank you however for your suggestions and effort to help, i really appreciate it.

    looking forward to return a favor,

    Mr. Alexander

  5. #5
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,023
    Mentioned
    210 Post(s)
    Tagged
    1 Thread(s)
    No problems. Glad that you found the error and corrected . We don't always get it but at least we try


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
  •