当前位置:首页 > 代码 > 正文

asp网站图片轮播代码(web实现图片轮播)

admin 发布:2022-12-19 20:09 136


今天给各位分享asp网站图片轮播代码的知识,其中也会对web实现图片轮播进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

如何在ASP网页上添加照片轮播

参考代码如下:

html xmlns="

head

meta http-equiv="Content-Type" content="text/html; charset=utf-8" /

style type="text/css" media="all"

.d1{width:443px;height:auto;overflow:hidden;border:#666666 2px solid;background-color:#000000;position:relative;}

.loading{width:443px;border:#666666 2px solid;background-color:#000000;color:#FFCC00;font-size:12px;height:179px;text-align:center;padding-top:30px;font-family:Verdana, Arial, Helvetica, sans-serif;font-weight:bold;}

.d2{width:100%;height:209px;overflow:hidden;}

.num_list{position:absolute;width:100%;left:0px;bottom:-1px;background-color:#000000;color:#FFFFFF;font-size:12px;padding:4px 0px;height:20px;overflow:hidden;}

.num_list span{display:inline-block;height:16px;padding-left:6px;}

img{border:0px;}

ul{display:none;}

.button{position:absolute; z-index:1000; right:0px; bottom:2px; font-size:13px; font-weight:bold; font-family:Arial, Helvetica, sans-serif;}

.b1,.b2{background-color:#666666;display:block;float:left;padding:2px 6px;margin-right:3px;color:#FFFFFF;text-decoration:none;cursor:pointer;}

.b2{color:#FFCC33;background-color:#FF6633;}

/style

script language="javascript" type="text/javascript"

/*

*/

//主函数

var s=function(){

var interv=2000; //切换间隔时间

var interv2=10; //切换速速

var opac1=80; //文字背景的透明度

var source="fade_focus" //焦点轮换图片容器的id名称

//获取对象

function getTag(tag,obj){if(obj==null){return document.getElementsByTagName(tag)}else{return obj.getElementsByTagName(tag)}}

function getid(id){return document.getElementById(id)};

var opac=0,j=0,t=63,num,scton=0,timer,timer2,timer3;var id=getid(source);id.removeChild(getTag("div",id)[0]);var li=getTag("li",id);var div=document.createElement("div");var title=document.createElement("div");var span=document.createElement("span");var button=document.createElement("div");button.className="button";for(var i=0;ili.length;i++){var a=document.createElement("a");a.innerHTML=i+1;a.onclick=function(){clearTimeout(timer);clearTimeout(timer2);clearTimeout(timer3);j=parseInt(this.innerHTML)-1;scton=0;t=63;opac=0;fadeon();};a.className="b1";a.onmouseover=function(){this.className="b2"};a.onmouseout=function(){this.className="b1";sc(j)};button.appendChild(a);}

//控制图层透明度

function alpha(obj,n){if(document.all){obj.style.filter="alpha(opacity="+n+")";}else{obj.style.opacity=(n/100);}}

//控制焦点按钮

function sc(n){for(var i=0;ili.length;i++){button.childNodes[i].className="b1"};button.childNodes[n].className="b2";}

title.className="num_list";title.appendChild(span);alpha(title,opac1);id.className="d1";div.className="d2";id.appendChild(div);id.appendChild(title);id.appendChild(button);

//渐显

var fadeon=function(){opac+=5;div.innerHTML=li[j].innerHTML;span.innerHTML=getTag("img",li[j])[0].alt;alpha(div,opac);if(scton==0){sc(j);num=-2;scrolltxt();scton=1};if(opac100){timer=setTimeout(fadeon,interv2)}else{timer2=setTimeout(fadeout,interv);};}

//渐隐

var fadeout=function(){opac-=5;div.innerHTML=li[j].innerHTML;alpha(div,opac);if(scton==0){num=2;scrolltxt();scton=1};if(opac0){timer=setTimeout(fadeout,interv2)}else{if(jli.length-1){j++}else{j=0};fadeon()};}

//滚动文字

var scrolltxt=function(){t+=num;span.style.marginTop=t+"px";if(num0  t3){timer3=setTimeout(scrolltxt,interv2)}else if(num0  t62){timer3=setTimeout(scrolltxt,interv2)}else{scton=0}};

fadeon();

}

//初始化

window.onload=s;

/script

titleJavascript图片幻灯效果/title

/head

body

div id="fade_focus"

    div class="loading"Loading...br /img src="/UploadPic/2009-3/200932411630437.gif" width="100" height="100" //div

    ul

      lia href="

展示图片1" //a/li

      lia href="

展示图片2" //a/li

      lia href="

展示图片3" //a/li

      lia href="

展示图片4" //a/li

    /ul

/div

/body

/html

求asp.net图片轮播代码

用flash+xml嘛, 直接去找一个, 把数据库中的数据保存到那个xml文件中就OK了啊

如何设置ASP网站产品展示图片自动滚动。

这个是需要连接数据库的 你没有数据库的话吧

%

dim product

set product=server.CreateObject("adodb.recordset")

product.open "select * from product order by px_id asc",conn,1,1

if product.eof and product.bof then

response.Write(" 暂无产品列表 !")

end if

while not product.eof

response.Write("a href=""/product/showproduct.asp?id=" product("id") """ title=""" product("title") """ img src="""product("img")""" width=""110"" height=""90""/ /a")

product.movenext

wend

product.close

set product=nothing

%

换成几个aimg src=""/ /a

就可以了

求一ASP网页图片循环滚动代码?

div id="c_9"

marquee direction="left" TrueSpeed scrollamount="1" scrolldelay="30" onMouseOver="this.stop();" onMouseOut="this.start();"

img src="images/p_0/p_1.jpg" width="150" height="130" border="1" /

img src="images/p_0/p_2.jpg" width="150" height="130" border="1" /

img src="images/p_0/p_3.jpg" width="150" height="130" border="1" /

/marquee

/div

附:循环滚动基本语法

marquee ... /marquee

移动属性的设置 ,这种移动不仅仅局限于文字,也可以应用于图片,表格等等

方向

direction=# #=left, right ,up ,down marquee direction=left从右向左移!/marquee

方式

bihavior=# #=scroll, slide, alternate marquee behavior=scroll一圈一圈绕着走!/marquee

marquee behavior=slide只走一次就歇了!/marquee

marquee behavior=alternate来回走/marquee

循环

loop=# #=次数;若未指定则循环不止(infinite) marquee loop=3 width=50% behavior=scroll只走 3 趟/marquee P

marquee loop=3 width=50% behavior=slide只走 3 趟/marquee

marquee loop=3 width=50% behavior=alternate只走 3 趟!/marquee

速度

scrollamount=# marquee scrollamount=20啦啦啦,我走得好快哟!/marquee

延时

scrolldelay=# marquee scrolldelay=500 scrollamount=100啦啦啦,我走一步,停一停!/marquee

外观(Layout)设置

对齐方式(Align)

align=# #=top, middle, bottom font size=6

marquee align=# width=400啦啦啦,我会移动耶!/marquee

/font

底色

bgcolor=# #=rrggbb 16 进制数码,或者是下列预定义色彩:

Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,

Fuchsia, White, Green, Purple, Silver, Yellow, Aqua marquee bgcolor=aaaaee颜色!/marquee

面积

height=# width=# marquee height=40 width=50% bgcolor=aaeeaa面积!/marquee

空白

(Margins)hspace=# vspace=#

marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle面积!/marquee

关于asp网站图片轮播代码和web实现图片轮播的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/22258.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载