hi there..
i want to hide a floating div if the user screen is < 1024 as it will overlay with my blog content area. i found this jquery on the net i am not sure how to use it.
$(document).ready(function() {
if ((screen.width>1024)) {
// if screen size is 1025px wide or larger
$
(".yourClass").css('display', 'none'); // you can also use $(".yourClass").hide();
}
elseif
((screen.width<=1024)) {
// if screen size width is less than 1024px
$
(".yourClass").css('display', 'block'); // here you can also use show();
}
});
my first question is, if my floating div class name is sharecontent, should i replace the above script like below? it yes, its not working.
$(document).ready(function() {
if ((screen.width>1024)) {
// if screen size is 1025px wide or larger
$
(".sharecontent").css('display', 'none'); // you can also use $(".yourClass").hide();
}
elseif
((screen.width<=1024)) {
// if screen size width is less than 1024px
$
(".sharecontent").css('display', 'block'); // here you can also use show();
}
});