You need to set the condition in jquery :
If aside.left_panel has style="display: none;" when the screen resolution is greater than 600px , then change in aside.left_panel to style="display: block" .
How can this issue be resolved?
You need to set the condition in jquery :
If aside.left_panel has style="display: none;" when the screen resolution is greater than 600px , then change in aside.left_panel to style="display: block" .
How can this issue be resolved?
I will correct the previous commentator a bit:
function screen_check(){ if ($(window).width() >= 600) { $('.left_panel').style('display', 'block'); } else { $('.left_panel').style('display', 'none'); }; } screen_check(); $(window).on('resize', function(){ screen_check(); }); Something like this:
$(window).resize(function(){ if ($(this).width() > 600) { $('.left_panel').style("display": "block"); } else { $('.left_panel').style("display": "none"); } }); and a couple more fixes and normal:
function screen_check(){ if ($(window).width() >= 600) { $('.left_panel').css('display', 'block'); } else { $('.left_panel').css('display', 'none'); };} .left_panel { display: none; } @media all and (min-width:600px) { .left_panel { display: block; } } PS: How many can you push the scripts anywhere?
Source: https://ru.stackoverflow.com/questions/436850/
All Articles