I've recently started using jquery and I have a task related to a drop-down menu that I'm struggling with:
if (scrnwidth <= 761) {
if (display was block) {
//Defaultly testi has display:none property.
testi = make testi display
}
else{
return false;
}
}
I haven't been able to get this task to work properly. How can I add CSS properties? I have checked for errors in the code but couldn't find any issues. Here's what I have so far:
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;
}
}
});
Any help would be greatly appreciated. Thank you.