Currently trying to maintain an object approach, at the moment I want to call a toggle method when a click handler is actioned. So the handler is within the init method and when i click the link I call the toggle_pane() passing the link that's been click 'this', does this sound right or what should I be doing? All advice welcome!
Here is the snippet of code I'm working on:
JS
init: function(){
var _ = this,
slides_li = _.els.slides.children();
// Click handlers
slides_li.on('click', function(e) {
_.toggle_pane(this);
});
},
toggle_pane: function(li){
var _ = this,
slides_li = _.els.slides.children();
if( !$(li).hasClass('active')) {
console.log( 'dont have active' );
}
}