javascript - else if statement with different paremeters -
i making statements site, , can't understand, how make such type of statement. here code
function checkwindowsize() { var pagewidth = $(window).width(); if (pagewidth < 751) { $('.tab-content div').removeclass('tab-pane'); $('#mytabs a').removeattr("data-toggle", "tab"); } else if (pagewidth < 751 && $(window).scrolltop()>=580;) { $('#faq .col-sm-3').addclass('fixed-faq'); $('.tab-content div').addclass('padd-top'); } else { $('#faq .col-sm-3').removeclass('fixed-faq'); $('.tab-content div').removeclass('padd-top'); $('#mytabs a').attr("data-toggle", "tab"); $('.tab-content div').addclass('tab-pane'); }; }; $(window).load(checkwindowsize); $(window).resize(checkwindowsize);
it works fine checking width , statements if, , else, when try make else if, 2 parameters of check, whole code stop working. can me ?
else if (pagewidth < 751 && $(window).scrolltop()>=580;)
remove semicolum line. move second else if condition first , first condition second.
Comments
Post a Comment