bigSlide.js
bigSlide.js copied to clipboard
Make menu open by default?
Hello. bigSlide is a great plugin! Thanks! I just have one question: is there any way to have the menu open on page load? I would like to have it default to open on certain pages of my site.
Best, Brad
im also looking to do this
Same as the others above, I'm looking to have the menu open by default, as well as create a cookie to remember the user's choice of open or closed.
I am also interested in this functionality. I would like to be able to have the active li be open when the page loads.
I forgot about this for a while but just came back to it and realized it's easy enough to just initialize the script for manual access to the functions (see the readme) and then call the bigSlide.open() function right after you initialize on any pages where you want it open by default.
@rabbitfighter nailed it. Thanks!
I've been meaning to make this an option when initializing the plugin to simplify things further.
Okay, so this took an hour or two to figure out, but I was able to add this to the functionality and it was actually really easy. Maybe ascott1 will implement this into his plugin - which is an amazing plugin, btw.
Open the uncompressed version of the plugin. Find this line:
var settings = $.extend({
Add this line under it:
'openDefault': false,
Find this line:
this.width = settings.menuWidth;
Add these lines under it:
if (settings.openDefault) {
$(document).ready(function() {
view.toggleOpen();
});
}
Save the file. Now you can use "openDefault" as an option - it's set to false by default.
$('.menu-link').bigSlide({
openDefault: true
});
I know this was an old topic, but I hope it helps someone as it's functionality that I needed.
Could this approach be modified to open the menu at a screen width (want it open at desktop by default closed for mobile)?