【发布时间】:2014-03-25 21:30:58
【问题描述】:
我正在使用最新的 jquery 构建 (ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js) 并将脚本链接在页面的头部,因为我还有其他需要它存在的功能。 我正在尝试使用添加到文档头部的简单展开/折叠功能来展开 FOREACH 语句中包含的内容。
我发现这个Unable to get JQuery-Mobile collapsible expand/collapse event to execute 在以下答案之一的小提琴示例中有效:http://jsfiddle.net/UT7kQ/ 但是当我将头部中的脚本更改为最新版本的 jquery 时,它不起作用。
这是我试图在 head 部分中用于展开/折叠 FOREACH 语句中包含的内容的代码:
$('.info').click(function(){
$(this).find('.hide').toggle();
});
建议?
【问题讨论】:
-
你试过用旧的$('document').ready()包裹它
标签: javascript jquery html css ajax