问题描述
想请教下listView怎么实现图片滑动效果呀????
解决方案
解决方案二:
ASP走马灯么~
解决方案三:
异步无刷新水平滑动图片效果//java设置<scripttype="text/javascript"language="javascript">varprm=Sys.WebForms.PageRequestManager.getInstance();prm.add_initializeRequest(initializeRequest);prm.add_endRequest(endRequest);varpostbackElement;functioninitializeRequest(sender,args){document.body.style.cursor="wait";if(prm.get_isInAsyncPostBack()){args.set_cancel(true);}}functionendRequest(sender,args){document.body.style.cursor="default";}//codego.net/tags/11/1/</script>//无刷新设置<asp:UpdatePanelID="upList"runat="server"UpdateMode="Conditional"><ContentTemplate>//ListView显示图片设置<asp:ListViewID="lvPhoto"runat="server"GroupItemCount="4"DataKeyNames="ID"><LayoutTemplate><divID="divPhoto"runat="server"align="center"style="width:650px;height:0px;margin:8px0px2px10px;padding:8px0px2px10px;text-align:center"><divID="groupPlaceholder"runat="server"></div></div></LayoutTemplate><GroupTemplate><divID="tr"style="width:100%;text-align:center"><divID="itemPlaceholder"runat="server"></div></div><divID="div1"style="height:5px"></div><divID="div2"style="height:20px;line-height:20px;"></div></GroupTemplate><ItemTemplate><divstyle="width:158px;float:left"><divstyle="width:155px;height:119px;background-image:url(images/001_07.gif);"><divstyle="width:100%;height:10px;line-height:10px;"></div><asp:LinkButtonID="lkbImg"runat="server"CommandArgument='<%#Eval("Url")%>'CommandName='<%#Eval("Descript")%>'oncommand="lkbImg_Command"><imgsrc='UpSmall/<%#Eval("Url")%>'alt='<%#Eval("Descript")%>'style="border-width:0px"width="133px"height="100px"/></asp:LinkButton></div><divalign="center"style="width:100%"><%#Eval("Title")%><br/></div></div></ItemTemplate></asp:ListView>//cs页面设置publicintcategoryID=-1;publicstringcategoryName=string.Empty;Albumam=newAlbum();//Page_PreRender事件,能防止单击两次按钮(这里指的是播放图片的按钮)来激发事件protectedvoidPage_PreRender(objectsender,EventArgse){if(Request.Params["CategoryID"]!=null){categoryID=Int32.Parse(Request.Params["CategoryID"].ToString());Session["categoryID"]=Request.Params["CategoryID"].ToString();if(Request.Params["CategoryName"]!=null){categoryName=lb_Cname.Text=Request.Params["CategoryName"].ToString();}}if(categoryID>0){BindListView();}if(!IsPostBack){DataSetds2=am.ShowPhoto(categoryID);if(ds2.Tables[0].Rows.Count>0){imgBig.Src="UpSmall/"+ds2.Tables[0].Rows[0]["Url"].ToString();sDescription.InnerHtml="照片描述:"+ds2.Tables[0].Rows[0]["Descript"].ToString();}}}//绑定数据到ListViewprivatevoidBindListView(){if(Session["categoryID"]!=null){DataSetds=am.ShowPhoto(Int32.Parse(Session["categoryID"].ToString()));if(ds.Tables[0].Rows.Count==0){Response.Redirect("UserLogin.aspx");}lvPhoto.DataSource=ds;lvPhoto.DataBind();}else{return;}}//单击小图片显示大图片protectedvoidlkbImg_Command(objectsender,CommandEventArgse){imgBig.Style.Add("visibility","visibe");imgBig.Src="UpSmall/"+e.CommandArgument.ToString();sDescription.InnerHtml=e.CommandName.ToString();}
解决方案四:
是WINFROM的~~~~~~~