| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 843 人关注过本帖
标题:为什么用datalist制作图片特效没反应呢?
只看楼主 加入收藏
恋雪怜冰
Rank: 1
来 自:苏州
等 级:新手上路
帖 子:84
专家分:2
注 册:2010-3-11
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:3 
为什么用datalist制作图片特效没反应呢?
我做了一个图片流动的效果,给它静态的几张图片效果是出来的
但是从数据库中读取出来,用datalist接受,图片不显示,没效果,请高手帮忙看下两段代码:
第一段:给多张图片的效果
<div align="center">
<!--滚动图片 start-->

<DIV class=rollphotos>
<DIV class=FixTitle>
<H3>旅游风景名胜</H3><SPAN><A href="/" target=_blank>更多>></A></SPAN></DIV>
<DIV class=blk_29>
<DIV class=LeftBotton id=LeftArr></DIV>
<DIV class=Cont id=ISL_Cont_1><!-- 图片列表 begin -->
<DIV class=box><A class=imgBorder href="/" target=_blank><IMG height=84 src="/jscss/demoimg/wall_s1.jpg" width=124
border=0></A>
<P><A href="/"
target=_blank>中国北京</A></P></DIV>
<DIV class=box><A class=imgBorder href="/" target=_blank><IMG height=84 src="/jscss/demoimg/wall_s2.jpg" width=124
border=0></A>
<P><A href="/"
target=_blank>生态旅游区</A></P></DIV>
<DIV class=box><A class=imgBorder href="/" target=_blank><IMG height=84 src="/jscss/demoimg/wall_s3.jpg" width=124
border=0></A>
<P><A href="/"
target=_blank>奥运馆场</A></P></DIV>
<DIV class=box><A class=imgBorder href="/" target=_blank><IMG height=84 src="/jscss/demoimg/wall_s4.jpg" width=124
border=0></A>
<P><A href="/"
target=_blank>瑞典山脉</A></P></DIV>
<DIV class=box><A class=imgBorder href="/" target=_blank><IMG height=84 src="/jscss/demoimg/wall_s5.jpg" width=124
border=0></A>
<P><A href="/"
target=_blank>体育旅游</A></P></DIV>
<DIV class=box><A class=imgBorder href="/" target=_blank><IMG height=84 src="/jscss/demoimg/wall_s5.jpg" width=124
border=0></A>
<P><A href="/"
target=_blank>福建武山</A></P></DIV>
<DIV class=box><A class=imgBorder href="/" target=_blank><IMG height=84 src="/jscss/demoimg/wall_s6.jpg" width=124
border=0></A>
<P><A href="/"
target=_blank>中国张家界</A></P></DIV>
<DIV class=box><A class=imgBorder href="/" target=_blank><IMG height=84 src="/jscss/demoimg/wall_s7.jpg" width=124
border=0></A>
<P><A href="/"
target=_blank>奥运开幕式</A></P></DIV><!-- 图片列表 end --></DIV>
<DIV class=RightBotton id=RightArr></DIV></DIV>
<SCRIPT language=javascript type=text/javascript>
        <!--//--><![CDATA[//><!--
        var scrollPic_02 = new ScrollPic();
        scrollPic_02.scrollContId   = "ISL_Cont_1";
        scrollPic_02.arrLeftId      = "LeftArr";//左箭头ID
        scrollPic_02.arrRightId     = "RightArr"; //右箭头ID
        scrollPic_02.frameWidth     = 908;//显示框宽度
        scrollPic_02.pageWidth      = 152; //翻页宽度
        scrollPic_02.speed          = 10; //移动速度(毫秒,越小越快)
        scrollPic_02.space          = 10; //每次移动像素(单位px,越大越快)
        scrollPic_02.autoPlay       = false; //自动播放
        scrollPic_02.autoPlayTime   = 3; //自动播放间隔时间(秒)
        scrollPic_02.initialize(); //初始化
        //--><!]]>
</SCRIPT>
</DIV>
<!--滚动图片 end-->

第二段:从数据库中读取的代码

<!--滚动图片 start-->

<div class="rollphotos" style="width:133%">
<div class="FixTitle">
<h3>旅游风景名胜</h3><span><a href="/" target="_blank">更多>></a></span></div>
<div class="blk_29" style="left: 0px; top: 0px">
<div class="LeftBotton" id="LeftArr"></div>
<div class="Cont" id="ISL_Cont_1" style="width: 782px"><!-- 图片列表 begin -->
    <asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" Height="234px" Width="114px">
        <ItemTemplate>
         <div class="box" style="height: 102px">
             <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%#Eval("picture") %>' CommandArgument='<%#Eval("painterID") %>' Height="120px" Width="100px" />
             <p><asp:LinkButton ID="LinkButton1" runat="server" Text='<%#Eval("pname") %>' CommandArgument='<%#Eval("painterID") %>' Height="120px" Width="100px"></asp:LinkButton></p></div>
        </ItemTemplate>
    </asp:DataList><!-- 图片列表 end --></div>
<div class="RightBotton" id="RightArr"></div></div>
<script language="javascript" type="text/javascript">
        <!--//--><![CDATA[//><!--
        var scrollPic_02 = new ScrollPic();
        scrollPic_02.scrollContId   = "ISL_Cont_1";
        scrollPic_02.arrLeftId      = "LeftArr";//左箭头ID
        scrollPic_02.arrRightId     = "RightArr"; //右箭头ID
        scrollPic_02.frameWidth     = 908;//显示框宽度
        scrollPic_02.pageWidth      = 152; //翻页宽度
        scrollPic_02.speed          = 10; //移动速度(毫秒,越小越快)
        scrollPic_02.space          = 10; //每次移动像素(单位px,越大越快)
        scrollPic_02.autoPlay       = true; //自动播放
        scrollPic_02.autoPlayTime   = 3; //自动播放间隔时间(秒)
        scrollPic_02.initialize(); //初始化
        //--><!]]>
</script>
</div>
<!--滚动图片 end-->
搜索更多相关主题的帖子: 特效 datalist 制作 
2010-09-18 18:31
bygg
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:乖乖的心中
等 级:版主
威 望:241
帖 子:13555
专家分:3076
注 册:2006-10-23
收藏
得分:14 
图片不显示?你看看你的"="/jscss/demoimg/wall_s1.jpg"这样的东西是不是正确的路径.

飘过~~
2010-09-19 12:11
恋雪怜冰
Rank: 1
来 自:苏州
等 级:新手上路
帖 子:84
专家分:2
注 册:2010-3-11
收藏
得分:0 
第一段代码是静态的,是有效果的 但第二段代码是图片不出来的
2010-09-19 12:24
bygg
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:乖乖的心中
等 级:版主
威 望:241
帖 子:13555
专家分:3076
注 册:2006-10-23
收藏
得分:0 
你运行出来时,点右键,看源码,再与第一段进行比较便可

飘过~~
2010-09-19 12:44
快速回复:为什么用datalist制作图片特效没反应呢?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014395 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved