已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
连数据库 图片切换 ASP.NET1.CSS.container width:262px; height:268px; border:1px solid #eee; position:relative;#idPicText background:#eee; line-height:25px; text-align:center; font-weight:bold; width:262px; white-space:nowrap; overflow:hidden; font-size:12px;#idPicText a text-decoration:none; color:#333; display:block;#idPicList img cursor:pointer; width:65px; height:50px; filter:alpha(opacity=50); -moz-opacity: .5; opacity: .5; border:0; margin:10px;#idPicList img.on filter:alpha(opacity=100); -moz-opacity: 1; opacity: 1;#idNum position:absolute; right:5px; bottom:5px;#idNum li float: left; list-style:none; color: #fff; text-align: center; line-height: 16px; width: 16px; height: 16px; font-family: Arial; font-size: 12px; cursor: pointer; margin: 1px; border: 1px solid #707070; background-color: #060a0b;#idNum li.on line-height: 18px; width: 18px; height: 18px; font-size: 14px; border: 0; background-color: #ce0609; font-weight: bold;2. JavaScriptvar isIE = (document.all) ? true : false;var $ = function (id) return string = typeof id ? document.getElementById(id) : id;var Class = create: function() return function() this.initialize.apply(this, arguments); var Extend = function(destination, source) for (var property in source) destinationproperty = sourceproperty; var Bind = function(object, fun) return function() return fun.apply(object, arguments); var Each = function(list, fun) for (var i = 0, len = list.length; i len; i+) fun(listi, i); ;/ie onlyvar RevealTrans = Class.create();RevealTtotype = initialize: function(container, options) this._img = document.createElement(img); this._a = document.createElement(a); this._timer = null;/计时器 this.Index = 0;/显示索引 this._onIndex = -1;/当前索引 this.SetOptions(options); this.Auto = !this.options.Auto; this.Pause = Math.abs(this.options.Pause); this.Duration = Math.abs(this.options.Duration); this.Transition = parseInt(this.options.Transition); this.List = this.options.List; this.onShow = this.options.onShow; /初始化显示区域 this._img.style.visibility = hidden;/第一次变换时不显示红x图 this._img.style.width = this._img.style.height = 100%; this._img.style.border = 0; this._img.onmouseover = Bind(this, this.Stop); this._img.onmouseout = Bind(this, this.Start); isIE & (this._img.style.filter = revealTrans(); this._a.target = _blank; $(container).appendChild(this._a).appendChild(this._img); , /设置默认属性 SetOptions: function(options) this.options = /默认值 Auto: true,/是否自动切换 Pause: 1000,/停顿时间(微妙) Duration: 1,/变换持续时间(秒) Transition: 23,/变换效果(23为随机) List: ,/数据集合,如果这里不设置可以用Add方法添加 onShow: function()/变换时执行 ; Extend(this.options, options | ); , Start: function() clearTimeout(this._timer); /如果没有数据就返回 if(!this.List.length) return; /修正Index if(this.Index = this.List.length) this.Index = 0; /如果当前索引不是显示索引就设置显示 if(this._onIndex != this.Index) this._onIndex = this.Index; this.Show(this.Listthis.Index); /如果要自动切换 if(this.Auto) this._timer = setTimeout(Bind(this, function() this.Index+; this.Start(); ), this.Duration * 4000 + this.Pause); , /显示 Show: function(list) if(isIE) /设置变换参数 with(this._img.filters.revealTrans) Transition = this.Transition; Duration = this.Duration; apply(); play(); this._img.style.visibility = ; /设置图片属性 this._img.src = list.img; this._img.alt = list.text; /设置链接 !listurl ? (this._a.href = listurl) : this._a.removeAttribute(href); /附加函数 this.onShow(); , /添加变换对象 Add: function(sIimg, sText, sUrl) this.List.push( img: sIimg, text: sText, url: sUrl ); , /停止 Stop: function() clearTimeout(this._timer); ;3, BODY var rvt = new RevealTrans(idPicShow); var imag=new Array(); var link=new Array(); var text=new Array(); var alt = new Array(); /获取后台cs代码的属性 imgUrls=; imgtexts=; imgLinks=; imgAlts=; imag=imgUrls.split(,); text=imgtexts.split(,); link=imgLinks.split(,); alt=imgAlts.split(,); /添加变换对象for(var i=0;i=3;i+) rvt.Add(imagi,alti,linki);/大图片/var oList = $(idPicList), oText = $(idPicText), arrImg = ;/小图片var oText = $(idPicText), arrImg = ;/文字说明 var oNum = $(idNum), arrNum = ;/数字/设置图片列表Each(rvt.List, function(list, i) /图片式 var img = document.createElement(img); img.src = listimg; img.alt = listtext; arrImgi = img; /oList.appendChild(img);/小图片 /按钮式 var li = document.createElement(li); li.innerHTML = i + 1; arrNumi = li; oNum.appendChild(li); /事件设置 img.onmouseover = li.onmouseover = function() rvt.Auto = false; rvt.Index = i; rvt.Start(); ; img.onmouseout = li.onmouseout = function() rvt.Auto = true; rvt.Start(); ;);/设置图片列表样式 文本显示区域rvt.onShow = function() var i = this.Index, list = this.Listi; /图片式 Each(arrImg, function(o) o.className = ; ); arrImgi.className = on; /按钮式 Each(arrNum, function(o) o.className = ; ); arrNumi.className = on; /文本区域 oText.innerHTML = !list.url ? + list.text + : list.text;/文本显示区域oText.onmouseover = function() rvt.Auto = false; rvt.Stop(); ;oText.onmouseout = function() rvt.Auto = true; rvt.Start(); ;rvt.Start();4.aspx.cspublic string imgtext = , imgUrl = , imgLink = ,imgAlt = ;protected void Page_Load(object sender, EventArgs e) if (!Page.IsPostBack) bind(); void bind() using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStringsconnstr.ConnectionString) SqlDataAdapter sda = new SqlDataAdapter(SELECT top 4 * from Player where PlayerState=0 order by PlayerCount desc, connection); DataSet ds = new DataSet(); DataTable dt = new DataTable(); DataSet uds = new DataSet(); DataTable udt = new DataTable(); sda.Fill(ds); dt = ds.Tables0; for (int i = 0; i ds.Tables0.Rows.Count; i+) string upFiURL = dt.RowsiUpFiID.ToString(); try string upFiID = upFiURL.Substring(0, upFiURL.IndexOf(,); SqlDataAdapter uda = new SqlDataAdapter(select * from
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小学一年级美术教学设计:集体画卷里的“小小我”
- 九年级数学圆的综合题专题复习教学设计
- 初中物理九年级《能源与可持续发展》核心素养导向单元教学设计
- 初中八年级语文名著导读雾都孤儿整本书阅读教学设计
- 初中九年级历史中考原创模拟卷七讲评与素养提升教学设计
- 高中化学必修二教学设计:化学品的合理使用与核心素养培育
- 小学三年级心理健康教育《合作互助好处多·团结协作》教学设计
- 初中道德与法治八年级上册《1.1 认识社会生活》教学设计:基于核心素养的情境化深度探究
- 九年级化学上册碳单质多样化教学设计
- 小学二年级美术教学设计:动物朋友会的形象创造与情境表演
- 中煤电力社会招录笔试试题2026
- 2026年溶剂油行业洞察报告及未来五至十年发展趋势报告
- 2026年初级会计资格考试《初级会计实务》真题+答案解析
- 高校外籍留学生管理安全培训
- 高三思想政治教学设计:必修四哲学原理举例说明的情境关联词教学实践
- T/QLMZ 19-2024化妆品用原料 海藻酸钠
- 幼儿同伴交往能力评估量表(PAS)实施规范
- 2026年退管人员测试题及答案
- 商会招聘笔试题及答案
- 癫痫诊疗指南(2025年版)
- 年中小学教师正高级职称评聘答辩试题附答案
评论
0/150
提交评论