i'd like to use these variables globally. the resize function does not work. only if i copy the variables. i want to use this code inside a document ready function.
thanks for your help.
var pageWidth = $('#page').width(),
pageWidthFifth = pageWidth / 5,
wrapAndSidebar = $('#sidebar-wrap, #sidebar');
wrapAndSidebar.width(pageWidthFifth);
$(window).resize(function(){
wrapAndSidebar.width(pageWidthFifth);
});
#pageelement? If that's the case, you must define those variables in a local content, for example inside a function. At the moment they are being populated upon page load and remain the same all the time.