一旦页面刷新,我的主题就会改变。一旦我们更改主题(刷新页面后),请帮助我获得相同样式的页面。
演示。 https://jsfiddle.net/aopf97z3/1/
刷新页面后,当前类不会出现。 代码:
<body>
<div class="theme_change">Change Your Theme</div>
<div class="content">The below content is the Test content</div>
</body>
CSS:
body {
background:#fff;
color:#000;
}
.content {
background:#f00;
color:#fff;
}
.black_theme {
background:#2180c7;
color:#000;
}
脚本:
$('.theme_change').on('click', function() {
$('body').toggleClass('black_theme');
$('this').toggle();
});
先谢谢。