Results 1 to 4 of 4

Thread: mobile version of Smooth Navigational Menu (v3.0)

  1. #1
    Join Date
    May 2015
    Location
    India
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default mobile version of Smooth Navigational Menu (v3.0)

    1) Script Title: Smooth Navigational Menu (v3.0)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...smoothmenu.htm

    3) Describe problem: I have added separate id to each submenu and I am loading different pages via jquery $(id).click() function because I wanted to add page loading animation.
    This method works in full width mode of the menu.
    When width of browser is reduced to lowest width for mobile miniature menu to display jquery click function does not work
    When width of browser again restored to show full menu it works
    Thanks

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I have added separate id to each submenu and I am loading different pages via jquery $(id).click() function because I wanted to add page loading animation.
    We'll need to see a link to your page in order to understand the problem, and offer solutions.

    I'm moving the thread out of the bug reports forum too because the issue appears to be with your setup rather then the original script.
    Last edited by Beverleyh; 05-28-2015 at 07:40 AM.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    May 2015
    Location
    India
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    HI
    Here is my actual code
    Menu part :
    Code:
    <div id='smoothmenu1'>
    		<ul>
    			<li><a id='home' href="#">Home</a></li>
    			<li><a href="#">About Us</a>
    			<ul>
    			<li><a href="#">History</a></li>
    			<li><a href="#">Office Bearer</a></li>
    			<li><a href="#">Aim &amp; Objective</a></li>
    			<li><a href="#">Bye-Laws</a></li>
    			</ul>
    			</li>
    			<li><a href="#">Activities</a>
    			<ul>
    			<li><a href="#">AGM</a></li>
    			<li><a href="#">CEC</a></li>
    			<li><a href="#">Other</a></li>
    			</ul>
    			</li>
    			<li><a href="#">Blog</a></li>
    			<li><a href="#">Downloads</a>
    			<ul>
    			<li><a href="#">Photo Gallery</a></li>
    			<li><a href="#">Important Documents</a></li>
    			<li><a href="#">Important Links</a></li>
    			</ul>
    			</li>
    			<li><a id='contact' href="#">Contact Us</a></li>
    		</ul>
    		<br style="clear: left" />
    	</div>
    Jquery part to load pages :
    Code:
    $(document).ready(function(){
    	$('#content').load('home.html');
    	$('#contact').click(function(){
    	//alert('contact');
    	$('#content').load('contact.html');
    	});
    	$('#home').click(function(){
    	//alert('contact');
    	$('#content').load('home.html');
    	});
    	});
    I tried to put the jquery part in <head> and <body> also.
    - Devendra

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Before getting to your question, firstly, it's helpful to quickly describe how the menu's two modes, desktop and mobile, work. When the page loads, the script generates one version of the menu matching the current page mode; if the user resizes the browser enough to meet the criteria of the other mode, another mode-specific, duplicate version of the menu is added to the page. In other words, you end up with two menus on the same page. FYI the desktop menu has a CSS class of "ddsmoothmenu", while the mobile menu's CSS class is "ddsmoothmobile".

    With that out of the way, using the "ID" attribute to target a particular menu item will only target that particular mode-specific menu item, and not both menus' menu item. You can try using a unique CSS class name instead:

    Code:
    <div id='smoothmenu1'>
    		<ul>
    			<li><a class='homeclass' href="#">Home</a></li>
    			<li><a href="#">About Us</a>
    			<ul>
    			<li><a href="#">History</a></li>
    			<li><a href="#">Office Bearer</a></li>
    			<li><a href="#">Aim &amp; Objective</a></li>
    			<li><a href="#">Bye-Laws</a></li>
    			</ul>
    			</li>
    			<li><a href="#">Activities</a>
    			<ul>
    			<li><a href="#">AGM</a></li>
    			<li><a href="#">CEC</a></li>
    			<li><a href="#">Other</a></li>
    			</ul>
    			</li>
    			<li><a href="#">Blog</a></li>
    			<li><a href="#">Downloads</a>
    			<ul>
    			<li><a href="#">Photo Gallery</a></li>
    			<li><a href="#">Important Documents</a></li>
    			<li><a href="#">Important Links</a></li>
    			</ul>
    			</li>
    			<li><a id='contact' href="#">Contact Us</a></li>
    		</ul>
    		<br style="clear: left" />
    	</div>
    When the above desktop menu is duplicated for its mobile menu counterpart, the class attribute is duplicated as well. Then in your jQuery code, you should be able to target both menus' menu item that way:

    Code:
    $(document).ready(function(){
    	$('.homeclass').click(function(){
    	//alert('contact');
    	$('#content').load('home.html');
    	});
    	});
    DD Admin

Similar Threads

  1. Replies: 2
    Last Post: 02-25-2019, 08:16 PM
  2. Smooth Navigational Menu for mobile devices
    By Cacho in forum Bug reports
    Replies: 2
    Last Post: 06-25-2012, 12:17 AM
  3. Replies: 12
    Last Post: 02-29-2012, 03:03 PM
  4. Smooth Navigational Menu
    By KantelData in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 02-02-2010, 08:39 PM
  5. Problem with Side version of All Levels Navigational Menu 2.2
    By amberj in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 01-07-2010, 05:45 PM

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
  •