Newbie question: how to trigger the execution of the following adaptive layout script when the page width is changed, if the script is in an external file (the link to it is added to <head> and it is executed once the page is formed)?
$(document).ready(function(){ var vp_width = $(window).width(); if (vp_width >= 240 && vp_width <= 320){ ... } }); I already learned that you should add an attribute with the value of <body> with the value of onResize , it remains only to deal with the value of this attribute. If this function had a name, it would not be difficult to call, but then there is just a construction with a function without a name.
function runCode() { // код }and add a call to this function wherever you needrunCode();- MasterAlex