我正在尝试使用以下代码在我的主页中实现Orbit Slider:
<script type="text/javascript" src="resources/js/jquery.js"></script>
<script type="text/javascript" src="resources/js/jquery.simplemodal.js"></script>
<script type="text/javascript" src="resources/js/help_support.js"></script>
<script type="text/javascript" src="resources/js/terms_conditions.js"></script>
<script type="text/javascript" src="resources/js/privacy_policy.js"></script>
<script type="text/javascript" src="resources/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="resources/js/jquery.orbit-1.2.3.min.js"></script>
<!--[if IE]>
<style type="text/css">
.timer { display: none !important; }
div.caption { background:transparent; filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000);zoom: 1; }
</style>
<![endif]-->
<script type="text/javascript">
$(window).load(function() {
$('#featured').orbit();
});
</script>
这样可行,但如果我将以下代码添加到我的页面,我想要显示Google Adsense广告,则滑块会停止在Safari,Chrome和Firefox中加载图片(出于某种原因,它仍适用于Opera)。
<div>
<script type="text/javascript">
<!--
google_ad_client = ad_client;
/* homepage_200x200_1 */
google_ad_slot = ad_slot;
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
我在这里发现了很多关于jQuery冲突的问题,并在网上发现了this useful page,但我是javascript的新手,我无法让我的实际代码工作。
你能帮我修理一下我的代码吗? 提前谢谢你......
答案 0 :(得分:0)
我遇到了完全相同的问题,经过研究后我发现了
$(window).load(function(){
应该是
$(function(){
我在这里找到了答案http://www.codingforums.com/showthread.php?t=253841