Adding/Removing classes on resize JQuery

https://www.sitepoint.com/community/t/adding-removing-classes-on-resize-jquery/191805

http://pastebin.com/PbqRV590

Sample Code shown in below::

$(window).on(‘load, resize’, function mobileViewUpdate() {
var viewportWidth = $(window).width();
if (viewportWidth < 768) {

$(“.topSocialList”).removeClass(“pull-right”).addClass(“pull-left”);
$(“.topSocialList”).find(“a”).css(‘border-right’,’0px’);

}

else{
$(“.topSocialList”).removeClass(“pull-left”).addClass(“pull-right”);
$(“.topSocialList”).find(“a”).css(‘border-right’,’1px solid #333333′);
}

});

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s