-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Description
var panel = $('selector').scotchPanel({ ... });
...
panel.open();
....isn't the jQuery way :-)
How about this?
$('selector').scotchPanel({ ... });
...
$('selector').scotchPanel('open');
....then we can always call the public methods without having to store the panel object at the time of creation.
And this way the object is still chainable, the jquery way :-)
$('selector').scotchPanel({ ... });
...
$('selector').addClass('something').data('whatever',true).scotchPanel('open');
...
$('selector').removeClass('something').data('whatever',false).scotchPanel('close');
You could also expand the number of public methods available like..
$('selector').scotchPanel({ ... });
$('selector').scotchPanel('open');
$('selector').scotchPanel('switch', 'right'); // change panel layout?
$('selector').scotchPanel('trigger', '.selector'); // add a new trigger
$('selector').scotchPanel('do_something', 'var 1', 'var 2'); // something entirely different?
ps.:
Of course we could still store $('selector') in a variable so we don't call it over and over again, but you get the point, I hope.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels