Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Page sideview menu help...

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

    Default

    Hi John:
    You can call the public function
    Code:
    toggle()
    immediately after the initialization code to open the menu automatically when the page loads:

    Code:
    sideviewmenu.toggle('open')
    DD Admin

  2. #12
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    Thank you for the reply !.

    When I use function immediately after the initialization code , Get " Error: Object doesn't support property or method 'toggle' "

    Below is the code and order I call it , its like the menu doesn't exist when "toggle" is called from the script in the heading . Am I calling the toggle in the correct place ?

    Thank you for looking at this

    regards,

    John.

    Code:
    <head>
    <meta name="viewport" content="width=device-width">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    
    <link href='http://fonts.googleapis.com/css?family=Asul:400,700' rel='stylesheet' type='text/css'>
    
    <link type="text/css" rel="stylesheet" href="sideviewmenu.css" />
    
    <script src="sideviewmenu.js">
    
    /***********************************************
    * Page Sideview Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
    ***********************************************/
    
    </script>
    
    <script>
    
    jQuery(function(){ // on DOM Load
      sideviewmenu({ // call sideviewmenu() function
       //menusource: 'inline',
       main_transition_duration: 0.4,
       onopenclose:function(state){ // state is either "open" or "closed"
       
       } 
      })
     } )
    
    sideviewmenu.toggle('open')
    </script>
    <link rel="stylesheet" href="menu.css" type="text/css">
    </head>
    
    <body>
    <div class="toggler" onClick="sideviewmenu.toggle()"></div>

  3. #13
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ... Sorry to try to bump this up the list , but its driving me crazy !!

    John...........

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

    Default

    Ah yes I forgot to account for some intricacies in the script. Anyhow, easiest way to accomplish this is just to use the below slightly modified .js version of the script. Then inside your initialization code, make use of the new "state" option to set the initial state of the menu to be open:

    Code:
    jQuery(function(){ // on DOM Load
    	sideviewmenu({ // call sideviewmenu() function
    		menuid: 'sideviewmenu',
    		state: 'close',
    		onopenclose:function(state){ // state is either "open" or "closed"
    			// custom code
    		}
    	})
    	
    })
    Attached Files Attached Files
    DD Admin

Similar Threads

  1. jQuery Drop Line Menu show open sub-menu on current page
    By madbird in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 06-09-2013, 05:52 PM
  2. 'New' tab >> Split Button Menu, goes to Anylink CSS menu page
    By Beverleyh in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 09-19-2012, 04:50 AM
  3. Replies: 1
    Last Post: 08-24-2009, 06:18 PM
  4. glossy accordion menu: how to highlight current menu item on target page?
    By gargiulo in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 02-18-2009, 02:31 PM
  5. Jim's DHTML Menu V5.7 - getting vertical menu to follow scrolling page
    By tech-woman in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 08-17-2005, 01:10 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
  •