【发布时间】:2012-01-26 19:53:41
【问题描述】:
手风琴脚本有问题,当我使用直接 html 使用手风琴时,手风琴可以工作,但现在转移到 wordpress 手风琴已经停止工作。
这是我的代码
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$("#accordion").accordion();
});
</script>
<?php wp_head(); ?>
和html:
<div id="accordion">
<div class="button"><a href="#">Infrastructure</a></div>
<div><?php
if (function_exists('iinclude_page')){
iinclude_page('sectors/infrastructure');
}?>
</div>
<div class="button"><a href="#">Housing</a></div>
<div><?php
if (function_exists('iinclude_page')){
iinclude_page('sectors/housing');
}?></div>
<div class="button"><a href="#">Education</a></div>
<div><?php
if (function_exists('iinclude_page')){
iinclude_page('sectors/education');
}?></div>
<div class="button"><a href="#">Health</a></div>
<div><?php
if (function_exists('iinclude_page')){
iinclude_page('sectors/health');
}?></div>
</div>
我真的不明白这个问题,因为它在直接 html 中工作。我什至尝试使用纯文本删除包含功能,但它仍然不起作用?
有什么想法吗?也没有其他 jquery 对象干扰。
【问题讨论】:
-
源代码中的 html 与您在浏览器中查看源代码时看到的 html 有什么区别吗?进行优化的插件将尝试挤出不必要的换行符。如果一般总是在空标签(脚本或其他)中放置一个 html 注释。