jQuery - 启用/禁用页面上的所有样式表单击 [英] jQuery – enable/disable all style sheets on page on click

查看:106
本文介绍了jQuery - 启用/禁用页面上的所有样式表单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以通过单击禁用/启用CSS按钮来检测当前页面上的所有样式表,并在第一次单击时禁用它们,因此不会应用任何样式,然后再次通过第二次点击恢复它们?

Is it possible to detect all style sheets on the current page with a click of a ‘disable/enable CSS’ button and disable them on the first click so none of the styling applies, and then restore them once again on second click? Any idea what the jQuery would look like, if it’s possible?

推荐答案

$('link[rel="stylesheet"]').attr('disabled', 'disabled');

这应该禁用所有的,然后相反的可重置它们:

this should disable all of them, then the opposite to renable them:

$('link[rel="stylesheet"]').removeAttr('disabled');

这篇关于jQuery - 启用/禁用页面上的所有样式表单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆