call function inside a nested jquery plugin
Posted
by tchoesang
on Stack Overflow
See other posts from Stack Overflow
or by tchoesang
Published on 2009-08-26T14:32:01Z
Indexed on
2010/03/24
10:03 UTC
Read the original article
Hit count: 173
jQuery
|JavaScript
There are many topics related to my question and i have been through most of them, but i haven't got it right. The closest post to my question is the following:
Below is the jquery plugin i am using. On resize, the element sizes are recalculated. I am now trying to call the function resizeBind() from outside of the jquery plugin and it gives me error
I tried the following combinations to call the function
$.fn.splitter().resizeBind()
$.fn.splitter.resizeBind()
Any ideas, where i am getting wrong?
;(function($){
$.fn.splitter = function(args){
//Other functions ......
$(window).bind("resize", function(){
resizeBind();
});
function resizeBind(){
var top = splitter.offset().top;
var wh = $(window).height();
var ww = $(window).width();
var sh = 0; // scrollbar height
if (ww <0 && !jQuery.browser.msie )
sh = 17;
var footer = parseInt($("#footer").css("height")) || 26;
splitter.css("height", wh-top-footer-sh+"px");
$("#tabsRight").css("height", splitter.height()-30+"px");
$(".contentTabs").css("height", splitter.height()-70+"px");
}
return this.each(function() {
});
};
})(jQuery);
© Stack Overflow or respective owner