- /**
- * Styleswitch stylesheet switcher built on jQuery
- * Under an Attribution, Share Alike License
- * By Kelvin Luck ( <a href="http://www.kelvinluck.com/">http://www.kelvinluck.com/ )
- **/
- (function($)
- {
- $(document).ready(function() {
- $('.styleswitch').click(function()
- {
- switchStylestyle(this.getAttribute("rel"));
- return false;
- });
- var c = readCookie('style');
- if (c) switchStylestyle(c);
- });
- function switchStylestyle(styleName)
- {
- $('link[@rel*=style][title]').each(function(i)
- {
- this.disabled = true;
- if (this.getAttribute('title') == styleName) this.disabled = false;
- });
- createCookie('style', styleName, 365);
- }
- })(jQuery);
- //该片段来自于http://www.codesnippet.cn/detail/110120131558.html
来源: http://www.codesnippet.cn/detail/110120131558.html