Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7891691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:40:57+00:00 2026-06-03T06:40:57+00:00

Apologies in advance if I’m using the wrong terminology, I’m pretty new to jQuery.

  • 0

Apologies in advance if I’m using the wrong terminology, I’m pretty new to jQuery.

I’m working on a site with a responsive design. At smaller screen sizes, the menu is replaced via jQuery/CSS with a select dropdown. (I append the <select> field via jQuery, default it to display:none via CSS, then display it at smaller resolutions via CSS media queries.)

It all works great, but there seems to be a conflict with another jQuery plugin I’m running which automatically displays larger versions of images in modal windows. See this page, click on the first image, then notice the <select> appears below the menu. http://preview.saratogaresources.com/corporate-governance/

This is the code I use to create the dropdown:

// Create the dropdown base
$("<select />").appendTo(".nav");

// Create default option "Go to..."
$("<option />", {
   "selected": "selected",
   "value"   : "",
   "text"    : "Go to..."
}).appendTo(".nav select");

// Populate dropdown with menu items
$(".nav a").each(function() {
 var el = $(this);
 $("<option />", {
     "value"   : el.attr("href"),
     "text"    : el.text()
 }).appendTo(".nav select");
});

$(".nav select").change(function() {
  window.location = $(this).find("option:selected").val();
});

This is my default CSS:

.nav select {
display:none;

}

And this is my media query:

@media all and (max-width: 800px) {

.nav .menu-top-menu-container {
    display:none;
}

.nav select {
    display:block;
    font-size:1em;
    margin:1em auto;
} 
}

The lightbox plugin works great on most sites I’m running so I’m betting it’s my code that’s the issue, but I don’t know jQuery very well. Any ideas would be most appreciated, thank you!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:40:58+00:00Added an answer on June 3, 2026 at 6:40 am

    I fixed this by running my jQuery within

    jQuery(window).load(function($)
    

    instead of

    jQuery(document).ready(function($)
    

    [EDIT]:
    Actually I don’t believe that the above was the final solution. I think what was happening was that in jQuery itself (latest version, 1.7.2) the <select> field’s style was being set to "" (blank, which translates to inline-block) after the modal window closed. If I understand right, this is a ‘fix’ for the issue of <select>s having some ridiculously high z-index in earlier versions of IE, and thus showing through modal windows. jQuery sets them to display:none for modal window display, then resets them after the window is closed.

    In my case, however, this had the result of adding display: inline-block to my previously hidden <select> element. I fixed this by adding an !important declaration to the CSS both places display: was being set. Whew!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apologies in advance, am fairly new to rails. Creating a site to showcase cooking
I'm pretty new to Node.js, so apologies in advance if I don't know what
Gentlepeeps, I'm new with Jquery. Apologies in advance for the basic question. I'm trying
This, I'm sure is a pretty basic question about JavaScript, so apologies in advance.
I'm new to Django, so apologies in advance if this is a rookie issue.
apologies in advance if i use poor terminology. when i compile a C++ app
I'm new to Python so apologies in advance if this is a stupid question.
Apologies in advance for the slightly wooly descriptions of what's going on. I'm pretty
I'm fairly new to Python, so my apologies in advance if this is much
I'm not so savvy with MYSQL, so my apologies in advance is this is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.