Home › Forums › JavaScript › Need Help In JQuery › Reply To: Need Help In JQuery
May 18, 2016 at 12:26 pm
#241846
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();
});