Hi John:
You can call the public functionimmediately after the initialization code to open the menu automatically when the page loads:Code:toggle()
Code:sideviewmenu.toggle('open')
Printable View
Hi John:
You can call the public functionimmediately after the initialization code to open the menu automatically when the page loads:Code:toggle()
Code:sideviewmenu.toggle('open')
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>
... Sorry to try to bump this up the list , but its driving me crazy !! :confused:
John...........
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
}
})
})