Trying to hide the left / right navigation text by listening to object & its properties.
working example : http://jsfiddle.net/ylokesh/9EyEu/29/
But, getting following error ” Uncaught TypeError: Cannot call method ‘hide’ of undefined “
if(!scroller) { var scroller = {}; }
scroller = {
next : "#leftControl",
prev : "#rightControl",
videos : {
hideButtons : function() {
var obj = this;
obj.next.hide();
obj.prev.hide();
},
init : function() {
var obj = this;
obj.hideButtons();
}
},
init : function() {
var obj = this;
obj.videos.init();
}
}
scroller.init();
Here is the corrected js to the issue:
As you see, I reference the
scrollerobject instead of thethis. In the cases where you were settingvar obj = thisthethiskeyword was not referencing thescrollerobject.