[JavaScript] 使用JQuery动态更换css样式表 →→→→→进入此内容的聊天室

来自 , 2021-04-09, 写在 JavaScript, 查看 151 次.
URL http://www.code666.cn/view/e41990b1
  1. /**
  2. * Styleswitch stylesheet switcher built on jQuery
  3. * Under an Attribution, Share Alike License
  4. * By Kelvin Luck ( http://www.kelvinluck.com/ )
  5. **/
  6.  
  7. (function($)
  8. {
  9.    $(document).ready(function() {
  10.       $('.styleswitch').click(function()
  11.       {
  12.          switchStylestyle(this.getAttribute("rel"));
  13.          return false;
  14.       });
  15.       var c = readCookie('style');
  16.       if (c) switchStylestyle(c);
  17.    });
  18.  
  19.    function switchStylestyle(styleName)
  20.    {
  21.       $('link[@rel*=style][title]').each(function(i)
  22.       {
  23.          this.disabled = true;
  24.          if (this.getAttribute('title') == styleName) this.disabled = false;
  25.       });
  26.       createCookie('style', styleName, 365);
  27.    }
  28. })(jQuery);
  29. //javascript/240

回复 "使用JQuery动态更换css样式表"

这儿你可以回复上面这条便签

captcha