Results 1 to 6 of 6

Thread: Responsive Side Toggle Menu Reversed

  1. #1
    Join Date
    Mar 2014
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Responsive Side Toggle Menu Reversed

    1) Script Title: Responsive Side Toggle Menu

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

    3) Describe problem: The code is brilliant and works beautifully, but what I'd like to do is reverse the code so that the menu is visible by default and then can be minimized/closed, rather than the original way of closed then opening.

    I was trying to tweak the default variables in slidetogglemenu.js, such as curstate: 'open' and visibility: 'visible'. This allowed the menu container to be visible, but I couldn't see any content until I minimized and reopened the menu. What other lines in the code do I need to change to get this working?

    Thanks!
    Last edited by adaml_ipa; 03-25-2014 at 08:13 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    In the JS file change
    Code:
    var defaults = {
    		position: 'left',
    		pushcontent: true,
    		source: 'inline',
    		revealamt: 0,
    		marginoffset: 0,
    		dismissonclick: true,
    		curstate: 'closed'
    }
    to
    Code:
    var defaults = {
    		position: 'left',
    		pushcontent: true,
    		source: 'inline',
    		revealamt: 0,
    		marginoffset: 0,
    		dismissonclick: true,
    		curstate: 'open'
    }
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  3. #3
    Join Date
    Mar 2014
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi Deadweight...

    Thanks for the reply. I've actually already tried this and although the "container" is open when the page loads, it is blank. There is no text or other content visible until I click on the button to close the menu and then again to open it. Is there another section of code in the JS file that needs to be edited?

  4. #4
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Sorry, I had a bit of a brain fart. The most simple way of actually doing this:
    Code:
    jQuery(function(){ // on DOM load
    	menu1 = new sidetogglemenu({  // initialize first menu example
    		id: 'togglemenu1',
    		marginoffset: 10
    	})
    	menu1.toggle();
    })
    Leave everything else the same. That also means switch back:
    Code:
    var defaults = {
    		position: 'left',
    		pushcontent: true,
    		source: 'inline',
    		revealamt: 0,
    		marginoffset: 0,
    		dismissonclick: true,
    		curstate: 'closed'
    	}
    Enjoy
    Last edited by Deadweight; 03-24-2014 at 05:50 PM.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  5. The Following User Says Thank You to Deadweight For This Useful Post:

    adaml_ipa (03-25-2014)

  6. #5
    Join Date
    Mar 2014
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Deadweight...Thank you so much for the time and effort in helping me out! It worked perfectly!

  7. #6
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    No problem, if that is all just remember to resolve your thread:
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved
    Last edited by Deadweight; 03-25-2014 at 10:14 PM.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

Similar Threads

  1. All Levels Navigational Menu (v3.02) Responsive Design?
    By carolineleonard in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 03-26-2013, 04:28 PM
  2. Smooth Navigational Menu (v1.5) want to display as dropline side by side
    By jqdesigner in forum Dynamic Drive scripts help
    Replies: 19
    Last Post: 01-30-2013, 03:35 PM
  3. Replies: 2
    Last Post: 09-17-2011, 10:15 PM
  4. Help !! Glossy Accordion Menu with responsive headers
    By tbellamy08 in forum Dynamic Drive scripts help
    Replies: 8
    Last Post: 05-08-2008, 04:04 PM
  5. Replies: 4
    Last Post: 09-27-2007, 04:36 AM

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
  •