Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Need Help In JQuery Reply To: Need Help In JQuery

#241846
amanda_
Participant

I would make the function at top of the document, then call the function within

 function doSomething(){
if ($(window).width() > 768) {
//functions go here
}
}

The run the function both within document ready and on window resize

$( document ).ready(function() {
doSomething();
});

$( window ).resize(function() {
 doSomething();
});