Results 1 to 3 of 3

Thread: Responsive Side Toggle Menu reversal

  1. #1
    Join Date
    Jun 2006
    Location
    Carmona, Seville, Spain.
    Posts
    66
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Responsive Side Toggle Menu reversal

    1) Script Title: Responsive Side Toggle Menu

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

    3) Describe problem: Rather than the side menu being open on page load, to have it open. This was answered elsewhere on this forum and the solution was:

    to the head code:

    Code:
    <script>
    jQuery(function(){
    	menu1 = new sidetogglemenu({
    		id: 'togglemenu1',
    	})
    })
    </script>
    Add: menu1.toggle();
    so we have:

    Code:
    <script>
    jQuery(function(){
    	menu1 = new sidetogglemenu({
    		id: 'togglemenu1',
    	})
        menu1.toggle();
    })
    </script>
    This looks fine on desktops BUT I'd like the small-sized screen version NOT to load the side menu open (the user is just presented with the menu covering the whole screen). So, can it be worked that over 480px the menu is OPEN and under 480px, the menu is CLOSED? Thank you in advance for your help.
    Last edited by keyboard; 12-03-2015 at 10:03 PM. Reason: Format: Added [code][/code] tags

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

    Default

    You could just conditionally call the toggle() method, something like:

    Code:
    <script>
    jQuery(function(){
    menu1 = new sidetogglemenu({
    id: 'togglemenu1',
    })
    
    if (screen.width > 480)
    menu1.toggle();
    })
    </script>
    or whenever the browser is 480px or less (even on desktop browsers):

    Code:
    <script>
    jQuery(function(){
    menu1 = new sidetogglemenu({
    id: 'togglemenu1',
    })
    
    if (window.innerWidth > 480)
    menu1.toggle();
    })
    </script>
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    green (12-03-2015)

  4. #3
    Join Date
    Jun 2006
    Location
    Carmona, Seville, Spain.
    Posts
    66
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    That works great! Thank you so much.

Similar Threads

  1. Responsive Side Toggle Menu
    By jdadwilson in forum Dynamic Drive scripts help
    Replies: 7
    Last Post: 12-16-2015, 06:45 PM
  2. Responsive Side Toggle Menu Enhancements
    By jdadwilson in forum Dynamic Drive scripts help
    Replies: 27
    Last Post: 11-15-2015, 08:55 AM
  3. Responsive Side Toggle Menu
    By Thin Lizzy in forum Dynamic Drive scripts help
    Replies: 7
    Last Post: 11-07-2015, 01:41 PM
  4. DOM errors in Responsive Side Toggle Menu?
    By chas in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 02-04-2015, 04:08 AM
  5. Resolved Responsive Side Toggle Menu Reversed
    By adaml_ipa in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 03-25-2014, 07:53 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
  •