Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.corpo_buttons_asia').click(function() {
- $('.info').css('visibility', 'hidden');
- $('.info2').css('visibility', 'visible');
- $(this).css('z-index', '20');
- $(this).css('background-color', 'rgb(23,55,94)');
- $(this).css('color', '#FFF');
- $('.corpo_buttons_global').css('background-color', 'rgb(197,197,197)');
- $('.corpo_buttons_global').css('color', '#383838');
- });
- $('.corpo_buttons_global').click(function() {
- $('.info').css('visibility', 'visible');
- $('.info2').css('visibility', 'hidden');
- $(this).css('background-color', 'rgb(23,55,94)');
- $(this).css('color', '#FFF');
- $('.corpo_buttons_asia').css('z-index', '2');
- $('.corpo_buttons_asia').css('background-color', 'rgb(197,197,197)');
- $('.corpo_buttons_asia').css('color', '#383838');
- });
- $('.theclassthatstherenow').addClass('newclasswithyourstyles').removeClass('theclassthatstherenow');
- $('.theclassthatstherenow').addClass('newclasswithyourstyles');
- $('.theclassthatstherenow').removeClass('theclassthatstherenow');
- var el = document.querySelector('.theclassthatstherenow');
- el.classList.remove('theclassthatstherenow');
- el.classList.add('newclasswithyourstylerules');
- var el = document.getElementsByClassName('theclassthatstherenow');
- el.className = el.className.replace(/s*theclassthatstherenows*/, ' newclasswithyourstylerules ');
- (function ($) {
- $.fn.replaceClass = function (pFromClass, pToClass) {
- return this.removeClass(pFromClass).addClass(pToClass);
- };
- }(jQuery));
- $('.divFoo').replaceClass('colored','blackAndWhite');
- <div class="divFoo colored"></div>
- <div class="divFoo blackAndWhite"></div>
- .active {
- z-index: 20;
- background: rgb(23,55,94)
- color: #fff;
- }
- $(this).addClass("active");
- .greenclass {color:green;}
- $('selector').addClass("green");
- $('selector').removeClass("green");
- $("#YourID").switchClass("old-class-here", "new-class-here");
- jQuery.fn.replaceClass = function(sSearch, sReplace) {
- return this.each(function() {
- var s = (' ' + this.className + ' ').replace(' ' + sSearch.trim() + ' ', ' ' + sReplace.trim() + ' ');
- this.className = s.substr(1, s.length - 2);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement