Friday, September 12, 2014

Making jQuery and Boostrap 3 and "hide" class work together

One of the problems with using jQuery's show and hide methods is that they are not compatible with the provided Bootstrap css classes "show" and "hide".

What is the problem? Bootstrap's css class looks like this:



.hide {
  displaynone !important;
}

Those important styles are necessary on some elements to make the behavior as expected. However, jQuery doesn't overwrite them when setting css attributes with the built-in show/hide methods. The recommended way that I found is to manually use .addClass("hide") and .removeClass("hide")...which is way too annoying.



Add the following JavaScript code after the initial jQuery .js file load and all is well.

var originaljQueryShow = jQuery.fn.show;
var originaljQueryHide = jQuery.fn.hide;
jQuery.fn.extend({
    show: function () {
        var result = originaljQueryShow.apply(this, arguments);
        jQuery(this).removeClass("hide");
        return result;
    },
    hide: function () {
        var result = originaljQueryHide.apply(this, arguments);
        jQuery(this).addClass("hide");
        return result;
    }
});


This lets the original functionality of the jQuery show() and hide() to be maintained, while adding transparent support for the Bootstrap css hide class.

9 comments:

kingrani

Flipkart is Offering Cashback Offers Flipkart Cashback Offer You will get upto 75% Discount

Flipkart is Offering Cashback Offers Flipkart Cashback Offers You will get upto 75% Discount

Flipkart is Offering Cashback Offers Flipkart big billion day offers You will get upto 75% Discount

Flipkart is one of the biggest world wide eCommerce Site so here you will getFlipkart big billion day offers

Flipkart is one of the biggest world wide eCommerce Site so here you will getflipkart bank cashback offersso

Flipkart is one of the biggest world wide eCommerce Site so here you will getFlipkart bank offersso

Anonymous

Nice blog. Thanks for sharing such informative blog.

Unknown

Superb post. Impressive writing skill. Thank u so much for sharing with us.
Selection Process of Police Govt Jobs

Mahesh chaube

Great article admin. i love the way you summarized this post.

lots of love from: Ramadan Song

AMAZON CASHBACK OFFERS ON SBI,HDFC,ICICI,CITI,ICICI,AXIS BANK OFFERS,AMAZON CASHBACK OFFERS


Amazon cashback offers 2018Cashback Deals with sbi,hdfc,icici,axis banks,credit&debit card,
Amazon Cashback Offers 2018 Upto 65% Cashback Deals, AMAZON CASHBACK OFFERS 2018, DISCOUNT COUPON OFFERS 2018, Amazon cashback offers with sbi hdfc icici axis banks credit&debit card offers more. amazon cashback offers2018,amazon india cashback,amazon offers on mobiles,amazon cashback2018,amazon offers 2018



cashbackoffer amazon coupon code| amazon coupon promo code| amazon offer coupon code|
amazon coupon code| amazon coupon promo code| amazon offer coupon code


About Airport Parking,Accor HotelsAffordable Asia,Agoda,Air Asia Go,Akbar Travels,Amoma,Azores Getaways,Big Bus Tours,Booking,CarmelLimo,CatchThatBus,CheapAir,CheapTickets Singapore,Cleartrip,Ctrip English speaking,Etihad Airways,Expedia,Expedia India, Expedia Indonesia Hotels, Flights & Packages,Travel Coupons, Offers: Flights, Hotels, Bus Promo Codes
accor HotelsAffordable Asia,Agoda,Air Asia Go,Akbar Travels,Amoma,Azores Getaways,Big Bus Tours,Booking,CarmelLimo,CatchThatBus,CheapAir,CheapTickets Singapore,Cleartrip,Ctrip English speaking,Etihad Airways,Expedia,Expedia India,

Expedia Indonesia Hotels, Flights & Packages

CashBack Offers, Discount Coupons, Bank Offers & Promo Codes


flipkart cashback offer,
CashBack Offers, Discount Coupons


Pepperfry, Mobikwik, Firstcry, Fab Hotels, Ebay, Aliexpress, Adidas, Healthkart, Pepperfry, Shoppers Stop, FlipKart, Amazon, Lurap, Giftalove, Reebok, SBI Card, CoolWinks, Housejoy, Shine, Jaypore, netmeds, FabAlley, Prettysecrets, FlowerAura, Clovia, Shopclues, Printvenue, Firstcry, Travelguru, Myntra, Zivame, Jabong, Ferns N Petals,Healthkart, Pepperfry, Shoppers Stop, FlipKart, Amazon


CashBack Offers, Discount Coupons, Bank Offers & Promo Codes

AMAZON CASHBACK OFFERS ON SBI,HDFC,ICICI,CITI,ICICI,AXIS BANK OFFERS,AMAZON CASHBACK OFFERS

Wonderful site and huge information. The information present here is helpful for the readers I'll come back to this blog for sure!



Flipkart CashBack Offers-SBI, HDFC, ICICI, Citibank Cards&Flipkart HDFC Cards Offers"
flipkart bank offers,flipkart cash back coupons,flipkart offers 2018,
flipkart coupons 2018,flipkart cashback offers 2018,flipkart cashback offers,
flipkart cash back offers,flipkart cashback coupons,
flipkart cashback,Flipkart Cashback Offers,Flipkart Bank Offers,Flipkart Deals 2018,
flipkart upcoming offers on mobiles,
hdfc credit card offers on flipkart 2018 flipkart sbi offer big billion day,
flipkart hdfc offer,
flipkart hdfc offer august 2018 sbi flipkart offer 2018 flipkart icici offer



FLIPKART CITIBANK OFFER,FLIPKART ICICI OFFER,
SBI CARD OFFERS ON FLIPKART,
FLIPKART CASHBACK OFFER TODAY,FLIPKART CREDIT CARD OFFERS,
ALL BANK CREDIT CARD OFFERS,HDFC CREDIT CARD OFFERS ON FLIPKART,
AXIS BANK CREDIT CARD OFFERS ON FLIPKART,
CITIBANK CREDIT CARD OFFERS ON FLIPKART,SBI FLIPKART OFFER



Flipkart Cashback Offers||Flipkart Bank Offers||Flipkart Deals 2018||flipkart upcoming offers,"
"Flipkart Cashback Offers || Flipkart Bank Offers || Flipkart Deals 2018 ||"
"flipkart upcoming offers on mobiles, hdfc credit card offers on flipkart 2018,
sbi credit card offers on flipkart today, flipkart hdfc offer terms and conditions,
sbi flipkart offer 2018,
flipkart cashback phonepe, flipkart hdfc offer august 2018, flipkart icici offer




"cashback,vouchers,coupons,discounts,offers,deals,promo codes,&Cashback Offers"
"cash back coupons "Coupons, Discounts & Offers on 1500+ Shopping Sites in India.
Get Extra Cashback Everytime You Shop Online using Coupons of Amazon, Flipkart,
Tata CLiQ, Nykaa etc."cashback, vouchers, coupons, discounts, offers, deals,
promo codes,Coupons, Promo Codes & Cashback Offers

AMAZON CASHBACK OFFERS ON SBI,HDFC,ICICI,CITI,ICICI,AXIS BANK OFFERS,AMAZON CASHBACK OFFERS



Musafir, My Bus Tickets, Myles, Orbitz, Qatar

Airways, Rehlat, Sixt Car Rental, Skyscanner, SOTC Holidays, Starline Tours, Thomas Cook, Ticket

Goose, Travelguru, Travel Talk Tours, Treebohotels


,Credit card offers in jabong,jabong hdfc

Cashback,jabong icici cashback,jabong sbi cashback,
Jabong Cashback Offers & Discount Coupons 2018 : Extra 20% Offer,jabong coupons, jabong offers,

hdfc jabong offer, icici jabong offer 2018, jabong footwear, sbi jabong offer, jabong axis bank

offer, jabong sbi offer 2018,jabong cashback Offers, jabong cashback, jabong Deals,Credit card

offers in jabong,jabong hdfc Cashback,jabong icici cashback,jabong sbi cashback ,jabong axis

cashback,jabong offers,Jabong cashback coupons,jabong offers


Online Sale - Online Sale Shopping of up

to 70% Of...
zivame cash back offers
Jabong Bank Coupons April 2018 for ICICI, SBI, HDF...
Ferns N Petals
Amazon today's deals great saving every day
Up to 40% off TVs & Appliances + Additional 10% cashback offers


amazon cashback offers,Amazon Cashback

Offers May 2018 Upto 65% Cashback Deals,Amazon cashback offers January,Amazon cashback offers

February,amazon cashback march,Amazon offers april , Cashback offers may , August cashback

amazon , September offers cashback November , Cashback offers on December , HDFC Credit card

offers on amazon,Axis Bank credit card offer on amazon,ICICI bank offers in amazon,Citi bank

cashback on amazon


Amazon cashback offers

January , Amazon cashback offers February , amazon cashback march , Amazon offers april ,

Cashback offers may , August cashback amazon , September offers cashback November , Cashback

offers on December , HDFC Credit card offers on amazon , Axis Bank credit card offer on amazon ,

ICICI bank offers in amazon , Citi bank cashback on amazon


make my trip citi credit and debit cards

offers:- ...
make my trip International hotel jaw -dropping dea...
make my trip first night free on 1st hotel booking...
Hurry! Get exciting discounts on Hotels & Flights ...
akbartravels save big upto 1000 off on flight book...
Exclusive offer: Get 15% OFF on HOTELS with Visa f...
Exclusive offer: Get 15% OFF on HOTELS with Visa ...
(10 may 18) : TRAVELSPICE 5 Star Hotels at 3 Star ...
Travelspice - 10 may 18 cashback offers
maake my trip anniversary trvel sale best deal int...
Makemytrip International Flights latest deals on ...
TopTravel Websites cashback offers &discounts upto


"Cashback Offers Coupons Offers you

dozens of Cashback offers with your Credit / debit / Net banking for Top eCommerce,cash back

offers coupons


Ferns N Petals ,ferns and petals login, ferns

and ...
shopclues paytm offer, shopclues 25 off coupon, sh...
myntra coupons, myntra cashback paytm, myntra hdfc...
Jabong Cashback - Jabong Offers, Cashback & Coupons,Cashback Coupons : CashBack Offers, Discount

Coupons & Promo

Slot เว็บ ตรง

เข้า เล่น pg พีจีสล็อต รองรับโทรศัพท์เคลื่อนที่ทุกระบบ เล่นได้ทุกหนทุกแห่ง แบบเกมนั้น ” รองรับภาษาไทย “ เป็นเกมสล็อตรูปแบบใหม่ pg slot พาทางเข้าเล่นมาให้คุณแล้วคลิกได้เลย

พีจีสล็อต

Kingkong PG ที่น่าเล่น เป็นเกมสล็อตออนไลน์ที่มีความน่าสนใจและเป็นที่นิยมอย่างมากในวงการเกมคาสิโนออนไลน์ โดยเกมนี้มีการออกแบบมาให้เป็นธีมของ PG SLOT