本文主要是介绍通过修改父类样式名。改变子类样式的,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
//html代码
//css样式代码
//jquery代码
$('.exclusive-fixed').on('click', '.exclusive-fixed-le', function (e) {
e.preventDefault();
$parent = $this.closest('.exclusive-fixed');
if($('.exclusive-fixed-before').length > 0){
$this.html('咨询<div class="arrow"></div>');
} else if ($('.exclusive-fixed-after').length > 0) {
$this.html('收起<div class="arrow"></div>');
});
$this.html('收起<div class="arrow"></div>');
.html();方法会完全覆盖html代码
这篇关于通过修改父类样式名。改变子类样式的的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!