PDA

View Full Version : Responsive Side Toggle Menu



Thin Lizzy
10-19-2015, 07:35 PM
1) Script Title: Responsive Side Toggle Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/sidetogglemenu.htm

3) Describe problem: How to enable to toggle the menu automatically, without clicking on the button?

Many thanks for your help.
TL

Beverleyh
10-19-2015, 07:39 PM
Please provide a link to the Dynamic Drive demo page.

vwphillips
10-20-2015, 09:22 AM
link to script home page
http://www.dynamicdrive.com/dynamicindex1/sidetogglemenu.htm

the call

menu1.toggle();
will toggle the menu if called within another function or by an onclick event

if the initialisation call is placed just before the </BODY> tag the menu will open as the page is opened


menu1 = new sidetogglemenu({ // initialize first menu example
id: 'togglemenu1',
marginoffset: 10,
downarrowsrc: 'toggledown.png'
})


the menu can also be opened or closed using keywords


<button onClick="menu1.toggle('open');" class="sideviewtoggle">Open Menu 1</button>
<button onClick="menu1.toggle('closed')" class="sideviewtoggle">Close Menu 1</button>


within a function or by an onclick event

Thin Lizzy
10-20-2015, 07:27 PM
Hi Beverleyh and vwphillips,

many thanks for your help. I have tried the suggestions but it seems sometimes it works, sometimes it doesn't work on my 17" monitor.

I tried to call the script with a body onload element:

<body onLoad="menu1.toggle('open');" class="sideviewtoggle">

Before the </body> tag I used this one:
<script>
menu1 = new sidetogglemenu({ // initialize first menu example
id: 'togglemenu1',
marginoffset: 10,
downarrowsrc: 'toggledown.png'
})

</script>

Should I use maybe a window.onload call?

Many thanks for your help.

vwphillips
10-21-2015, 08:08 AM
place the initilization and open call just before the </BODY> tag


<script>
menu1 = new sidetogglemenu({ // initialize first menu example
id: 'togglemenu1',
marginoffset: 10,
downarrowsrc: 'toggledown.png'
})

menu1.toggle('open');
</script>

</body>


if this still has problems post a link to your page

Thin Lizzy
10-21-2015, 05:25 PM
Hi, Vic,

it seems I have to be more accurate in my question. So: my menu toggles, the menu makes for yourself the room but it has no content, it is empty.

When I use the onClick event the menu works and also his contain is visible. The only difference between the two methods is the <class="sideviewtoggle"> which is present in the onClick command but isn't present in your code above. How to cal this class in the script?

Many thanks.

vwphillips
10-22-2015, 10:21 AM
your last post only adds confusion

please post a link to the problem page

Thin Lizzy
11-07-2015, 01:41 PM
Sorry for my late answer. I have tried many solutions to find a working one, and finally I have found the absolute best here:
http://www.dynamicdrive.com/forums/showthread.php?76610-Responsive-Side-Toggle-Menu-Reversed

Many thanks once again for your recommendations and help. My question can be marked as Resolved, too. Long live Dynamicdrive!