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

  • Home
  • SEARCH
  • 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 9213815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:50:10+00:00 2026-06-18T01:50:10+00:00

I’ve got a menu that uses the jQuery toggle function to open and close

  • 0

I’ve got a menu that uses the jQuery toggle function to open and close a sub-menu. This is working perfectly fine in all of my pages, BUT, when I try to add this same menu and sub-menu into a jQuery dialog box it will not open the sub-menu.

Here is my index.php code, including the javascript includes from the <head> of the page:

<script src="javascripts/jq/jquery-1.4.2.min.js"></script>
<script src="javascripts/jq/jquery-v1.8.3.js"></script>
<script src="javascripts/jq/jquery-v1.9.2.js"></script>

<p align="center" id="temp_menuOpener">[Click Here to Toggle Menu]</p>

<div id="temp_menu">
    <table cellpadding="0" cellspacing="0" border="0">
        <tr>
        <td class="ui-corner-bl ui-corner-br cus-dialog-content"><?php include("includes/menu.php");?></td>
        </tr>
    </table>
</div>

<script>
    $( "#temp_menu" ).dialog({ autoOpen: false, width: 'inherit'});
    $( "#temp_menuOpener" ).click(function() {
    $( "#temp_menu" ).dialog( "open" );
    });
</script>

Here is my menu.php code:

<script>
$(function()
    {
    $('.schedOpener').click(function()
        {
        $('div#submenu_sched').toggle();
        });
    });
</script>

<div id="menu">
    <div class="menu schedOpener">
    <img src="/roster/images/menu/schedule.png" border="0" title="Schedule" alt="Schedule">
    </div>

    <div id="submenu_sched">
        <div class="menu">
        <a href="/roster/sched/sched_month.php" target="_parent"><img src="/roster/images/menu/sched_month.png" border="0" title="Schedule Month View" alt="Schedule Month View"></a>
        </div>
    </div>

</div>

The CSS for submenu_sched is set to display:none;.

So, like I said, this menu works perfectly until it’s added to a dialog box and then it fails. Simply removing id="temp_menu" from the <div> will make it work, but that also removes it from the dialog box.

I tried adding this to a jsfiddle, but I couldn’t get the dialog box to work at all, even when I chose the jQuery 1.8.3 library framework. So instead I set it up on my test server to make it so you can at least see what I mean. You will notice on my test server there is more to the menu, and the page itself, than what I’ve posted here. I am trying to keep the static to noise ratio at a good level 🙂

IWACTITE

  • 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-18T01:50:11+00:00Added an answer on June 18, 2026 at 1:50 am

    Alright, after a while playing around on jsFiddle, I’ve figured all the problems out. First the JavaScript shouldn’t be inside the dialog. Secondly, you have to use ($("#temp_menu").dialog("isOpen") == true) ? $("#temp_menu").dialog("close") : $("#temp_menu").dialog("open"); to compare whether to open or close the dialog.

    Here’s my working jsFiddle
    and here’s the fullscreen version jsFiddle.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I know there's a lot of other questions out there that deal with this
I need a function that will clean a strings' special characters. I do NOT
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a small JavaScript validation script that validates inputs based on Regex. I

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.