PDA

View Full Version : jquery variables



ggalan
01-05-2011, 08:50 PM
i seem to be having problems passing in dynamic variables into jquery like this


function scrnSlide(){
var screen_width = document.body.offsetWidth;
var screen_height = document.body.offsetHeight;
$("#swipeMask").css({width:screen_width, height:screen_height});

};


any ideas how to make this work?
thanks

algo web dizajn
01-05-2011, 11:57 PM
if you're using Jquery, why don't you go with $(document).width() and .height() instead of document.body.offsetWidth;

ggalan
01-06-2011, 02:27 AM
that worked well, thanks