javascript - Jquery add property values to css -
i'm new jquery. want task on drop-down menu below:
if (scrnwidth <= 761) { if (display block) { //defaultly testi has display:none property. testi = make testi display } else{ return false; } }
that task not working me. how add css properties?? didn't found errors. here's code:
jquery('.menu_toggler').click(function () { var scrnwidth = jquery(window).width(); var display = jquery('.mobile_menu_wrapperr'); var testi = jquery('.main_header'); if (scrnwidth <= 761) { if (display.css("display") === "block") { testi = testi.css("display" == "none"); } else{ return false; } } });
thanks in advance.
syntax incorrect
testi = testi.css("display" == "none");
correct syntax
testi = testi.css("display","none");
or
testi.hide();
wiki
Comments
Post a Comment