Bootstrap Dropdown Menu in Safari

Posted on 2012-08-27
Last Modified: 2012-09-18
I'm working on a project using bootstrap.  I have a dropdown menu that renders fine in ie9, firefox and chrome.

You can view the page here:

On the dropdown I have a spot to enter in your email address.  It's a simple text field.

In safari this text field creates a problem.  If you rollover "Support" and try to click on the text box, the menu diappears.  As soon as the mouse enters the text field, the menu disappears regardless if you click it or not.

Again, this all functions as it is supposed to in Fire Fox, Chrome and IE.

Any ideas?
Question by:slightlyoff
    LVL 25

    Expert Comment

    by:Kyle Hamilton
    It doesn't do that in my Safari on Mac. I haven't tried it in Safari on PC - I'm not sure too many people use Safari on PC... Anyway, it probably has to do with the fact that, essentially, you have "moused out" of the dropdown once you enter into the text field area. It has to do with event bubbling. You could try adding the following to your script:

    $(".nav").mouseover(function(e) {

    You should also use mouseenter, and mouseleave instead of mouseover and mouseout. That in itself may stop the undesired behavior in Safari.

    But I'm wondering why you're using javascript for this. This can be easily done with just CSS.
    LVL 1

    Author Comment

    On your mac you can click on the text box and type stuff in?

    Thanks for your response, btw.  ;)

    I am coding using bootstrap because the original developer used bootstrap and all I was supposed to do was clean it up and add the forms.

    I was able to use e.stopPropagation earlier to make the form work on the other browsers, but I haven't been successful with Safari.  I'll give you suggestion a try.

    Thank you!
    LVL 25

    Accepted Solution

    yes. I was able to type into the field on my Mac Safari(V6)

    Best cleanup would be to get rid of the javascript and do it in plain CSS, they're just hovers :)

    LVL 1

    Author Closing Comment

    Sorry, I forgot to mark this as solved.  Thank you for your help!
    LVL 25

    Expert Comment

    by:Kyle Hamilton
    No problem. Thanks. :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now