I have a function that check if CSS value exists, the problem is that I need the function to work only when the CSS class exists, currently the function running all the time because I'm using else condition (that need to re do the if condition).
//use for @media only screen and (max-width: 767px) detection
$(window).resize(function(){
if ($('#mobile-view').css('visibility') === 'hidden') {
$("#product-gallery").insertAfter("#product-info");
}
else {
$("#product-info").insertAfter("#product-gallery");
}
});