I wrote a jQuery plugin, which set the DOM size to the window size. When i resize the window i want to follow it, but it not work. Here is the code:
(function( $ ){
$.fn.fullScreen = function() {
return this.each(function() {
$(this).css({
"width" : $(window).width(),
"height" : $(window).height()
})
$(window).resize(function() {
$(this).css({
"width" : $(window).width(),
"height" : $(window).height()
})
})
});
};
})( jQuery );
In your code the $(this) in the windows resize event is refering to window. Try: