【问题标题】:Bootstrap chevron icon doesn't change onclick, why?Bootstrap chevron 图标在点击时不会改变,为什么?
【发布时间】:2013-04-25 09:46:09
【问题描述】:

我有这个部分:

<div id="weather">
<h4><i class="icon-chevron-down"></i> Weather</h4>

和代码:

$('#weather h4').click(function (){
    $('#weather .entries').toggle();
    $('#weather .icon-chevron-down').toggleClass('icon-chevron-right');
});

jsbin1

它不起作用,但如果我更改 icon-chevron 的位置,它会起作用:

jsbin2

这是一个错误还是我做错了什么??

【问题讨论】:

标签: jquery twitter-bootstrap


【解决方案1】:

这个正在工作:

http://jsbin.com/omerep/1/edit

$('#weather h4').click(function (){
    $('#weather .entries').toggle();
    $(this).find('i').toggleClass('icon-chevron-right icon-chevron-down', 200);
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-12
    • 2011-08-24
    • 2018-12-16
    相关资源
    最近更新 更多