大家好!!
下面是一段代码:
$(document).ready(function() {
$("img#advsheadlbpic_0").show();
setInterval("$().advsHeadLbRoll()", 5000);
(function($){
$.fn.advsHeadLbRoll = function(){
var rollobj=$(".advsheadlbpic");
var rolltotal=parseInt(rollobj.size())-1;
var nextId,nowId;
$("img.advsheadlbpic").each(function(){
if(this.style.display=='block' || this.style.display=='inline'){
nowId=parseInt(this.id.substr(14));
if(nowId>=rolltotal){
nextId=0;
}else{
nextId=nowId+1;
}
}
});
$("img#advsheadlbpic_"+nextId).fadeIn('slow').show('slow');
$("img#advsheadlbpic_"+nowId).fadeOut('slow').hide();
};
})(jQuery);
});
在 .aspx* 调用:<head id="Head1" runat="server">
<title>首页</title>
<script src ="/js/advsheadlb.js" type ="text/javascript" ></script>
</head>在div里要显示的图片广告: <div id="advsheadlb">
<img id="advsheadlbImages_0" class="advsheadlbpic" border="0" src="Images/1285659686.jpg"alt =""/>
<img id="advsheadlbImages_1" class="advsheadlbpic" border="0" src="Images/1285659690.jpg" alt =""/>
</div>
页面运行的时候图片不显示? 以上代码哪里出错 了呢?求解!!!!!谢谢。。
下面是一段代码:
$(document).ready(function() {
$("img#advsheadlbpic_0").show();
setInterval("$().advsHeadLbRoll()", 5000);
(function($){
$.fn.advsHeadLbRoll = function(){
var rollobj=$(".advsheadlbpic");
var rolltotal=parseInt(rollobj.size())-1;
var nextId,nowId;
$("img.advsheadlbpic").each(function(){
if(this.style.display=='block' || this.style.display=='inline'){
nowId=parseInt(this.id.substr(14));
if(nowId>=rolltotal){
nextId=0;
}else{
nextId=nowId+1;
}
}
});
$("img#advsheadlbpic_"+nextId).fadeIn('slow').show('slow');
$("img#advsheadlbpic_"+nowId).fadeOut('slow').hide();
};
})(jQuery);
});
在 .aspx* 调用:<head id="Head1" runat="server">
<title>首页</title>
<script src ="/js/advsheadlb.js" type ="text/javascript" ></script>
</head>在div里要显示的图片广告: <div id="advsheadlb">
<img id="advsheadlbImages_0" class="advsheadlbpic" border="0" src="Images/1285659686.jpg"alt =""/>
<img id="advsheadlbImages_1" class="advsheadlbpic" border="0" src="Images/1285659690.jpg" alt =""/>
</div>
页面运行的时候图片不显示? 以上代码哪里出错 了呢?求解!!!!!谢谢。。
解决方案 »
- 请教个使用DirectX SDK开发视频播放功能的问题
- masterpage中js变量名的问题。
- 某按钮,按了后就能把设定好的邮件内容发给这人,还有其他人的类似按钮,这功能怎么做
- 请教一个dotlucene的问题
- 求blog源码供学习
- 谁能告诉我怎样asp.net结合AutoCAD做二次开发!
- <asp:boundcolumn datafield="CustomAccept" headertext="签收"/>如何让该列显示和CustomAccept相关的值
- 请教Char.IsMunber()如何用?
- .Net Web设计
- 获取服务器MAC地址的问题(高手快来!)
- asp.net 报表权限问题
- Lucene.net 的使用方法
用FF调试瞅瞅。