Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery Twitter Javascript插件“;“引导”;_Jquery_Jquery Plugins_Twitter Bootstrap - Fatal编程技术网

Jquery Twitter Javascript插件“;“引导”;

Jquery Twitter Javascript插件“;“引导”;,jquery,jquery-plugins,twitter-bootstrap,Jquery,Jquery Plugins,Twitter Bootstrap,我刚刚掌握了隐藏和显示的基本知识 这是一个工作示例代码: <div id="content" class="collapse" > //Place content in here </div> <a href="content" data-toggle="collapse" style="cursor:pointer;">Read More</a> 我不明白的部分是什么是“菌落”?这是缩小的div id吗?使用它是正确的 $('#content'

我刚刚掌握了隐藏和显示的基本知识

这是一个工作示例代码:

<div id="content" class="collapse" >
//Place content in here
</div>
<a href="content" data-toggle="collapse" style="cursor:pointer;">Read More</a>

我不明白的部分是什么是“菌落”?这是缩小的div id吗?

使用它是正确的

$('#content')
而不是使用

$('#myCollapsible')

在您的情况下:)

完整的解决方案是:

$( '#content' ).on( 'hidden', function() {
    $( 'a[href="' + this.id + '"]' ).html( 'Read More' );
}).on( 'shown', function() {
    $( 'a[href="' + this.id + '"]' ).html( 'Read Less' );
});

如果你想要一些通用的东西,你可以用
$('.#content')
替换
$('.collapse')

你能添加JSFIDLE作为证明吗?
$( '#content' ).on( 'hidden', function() {
    $( 'a[href="' + this.id + '"]' ).html( 'Read More' );
}).on( 'shown', function() {
    $( 'a[href="' + this.id + '"]' ).html( 'Read Less' );
});