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 8160885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:22:39+00:00 2026-06-06T18:22:39+00:00

I am trying to implement a javascript toggle effect for my small or mobile

  • 0

I am trying to implement a javascript toggle effect for my “small” or mobile sized version of a responsive site. I am using my own custom WordPress theme.

I’m trying to use the script from this article: http://webdesignerwall.com/tutorials/mobile-navigation-design-tutorial/comment-page-1

The tricky part is that I’m trying to include several divs, not just a single nav. If you look at the site now (which is still under construction), at:

http://66.147.244.81/~assureva/

and reduce your browser window to narrower than 540px, you’ll see that I’ve managed to get my top navbar (smallnav), 2 “login” links, and facebook and LinkedIn icons, all to disappear, and re-appear when pressing the “main menu” button that now appears at the top, to the right of the logo. But I can’t seem to add in the last part, which is the 4 links that comprise the main “nav”. I’ve wrapped the entire area in a div (mobimenubg), but the main navbar acts like it isn’t in that div, but the “smallnav”, “logins” and “socialcons” divs all combine as desired in the “mobimenubg” div.

If I go ahead and set the “navbar” div to “display:none” it will disappear but it won’t re-appear when I click the “main menu” button.

So I think the answer to ask the javascript to include the “mobimenubg” div AND the “navbar” div (the “navbar div is a container that includes the actual “nav”) but I don’t know how to write it properly.

Here’s the javascript:

<script type="text/javascript">
jQuery(document).ready(function($)
{/* prepend menu icon */
$('#mobimenuwrap').prepend('<div id="menu-icon">Main Menu</div>');
/* toggle nav */
$("#menu-icon").on("click", function(){
    $("#mobimenubg").slideToggle();
    $(this).toggleClass("active");
}); 
    }); 
   </script>

Can someone tell me how add the navbar div? Do I add another line after:

$("#mobimenubg").slideToggle();

or can I include it in the parens:

$("#mobimenubg" IN HERE?).slideToggle();

I don’t know the conventions –

Help greatly appreciated!!

  • 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-06T18:22:41+00:00Added an answer on June 6, 2026 at 6:22 pm

    I’ve wrapped the entire area in a div (mobimenubg), but the main navbar acts like it isn’t in that div,

    You actually have the right code, but your HTML structure is off. The navbar div is not contained within the mobimenubg div, and that is the problem. Just make sure to nest navbar there, or otherwise I think you can also call the function on the navbar like:

    $("#navbar").slideToggle();
    

    inspector screenshot

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

Sidebar

Related Questions

I am trying to implement a lighting effect in an HTML5/JavaScript game using tile
I'm trying to implement chained filter dropdown using just javascript - jquery. The solution
I'm trying to implement swiping gestures for mobile devices in HTML/CSS & Javascript. It's
I'm trying to implement Orbit Slider in my homepage using this code: <script type=text/javascript
I am trying to implement a simple floating navigation using the DOM and Javascript.
I'm trying to implement a chat client using JavaScript. The client is constructed using
I'm trying to implement a BigInt type in JavaScript using an array of integers.
I am trying to implement lazy high charts using the following github site GitHub
I'm trying to implement this gallery on my site: http://tympanus.net/Tutorials/SweetThumbnails/ I'm using the CSS
I've been trying to implement JavaScript thats read my twitter account ant return to

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.