asp.net - How can I add jQuery fadeIn to my listview on page change? -
i want make imageset class in webform page fadein on changing page of listview. how can this? code below doesn't seem work... jquery script isn't working. ideas?
head section of masterpage...
<head runat="server"> <title>cukiernia Łobza</title> <link rel="stylesheet" href="styles/user.css" type="text/css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"/> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <script src="js/lightbox.min.js"></script> <link href="styles/lightbox.css" rel="stylesheet" /> <script type="text/javascript"> $(document).ready(function () { $('.imageset').fadein(2000); }); </script> </head>
asp code of webform page...
<asp:content id="content1" contentplaceholderid="contentplaceholder1" runat="server"> <div id="leftside"> <asp:scriptmanager id="scriptmanager1" runat="server"></asp:scriptmanager> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <div class="btnup"> <asp:datapager id="datapager1" runat="server" pagedcontrolid="listview1" pagesize="3"> <fields> <asp:nextpreviouspagerfield buttontype="image" firstpagetext="" lastpagetext="" nextpagetext="" previouspageimageurl="~/images/arrowbtnup.png" previouspagetext="" shownextpagebutton="false" /> </fields> </asp:datapager> </div> <div class="imageset"> <asp:listview id="listview1" runat="server" datasourceid="sqldatasource1" datakeynames="id"> <alternatingitemtemplate> <asp:imagebutton id="imagebutton2" runat="server" imageurl='<%# eval("image1", "{0}") %>' postbackurl='<%# eval("id", "~/oferta.aspx?cat=" + request.querystring["cat"] + "&sub=" + request.querystring["sub"] + "&id={0}") %>' width="180px" height="120px" cssclass="imagebtn" commandname="choose" /> </alternatingitemtemplate> <itemtemplate> <asp:imagebutton id="imagebutton1" runat="server" imageurl='<%# eval("image1", "{0}") %>' postbackurl='<%# eval("id", "~/oferta.aspx?cat=" + request.querystring["cat"] + "&sub=" + request.querystring["sub"] + "&id={0}") %>' width="180px" height="120px" cssclass="imagebtn" commandname="choose" /> </itemtemplate> </asp:listview> <asp:sqldatasource id="sqldatasource1" runat="server" connectionstring="<%$ connectionstrings:connectionstring %>" selectcommand="select * [c_produkty] (([kategoria] = @kategoria) , ([subkategoria] = @subkategoria)) order [id]"> <selectparameters> <asp:querystringparameter name="kategoria" querystringfield="cat" type="int32" /> <asp:querystringparameter name="subkategoria" querystringfield="sub" type="int32" /> </selectparameters> </asp:sqldatasource> </div> <div class="btndown"> <asp:datapager id="datapager2" runat="server" pagedcontrolid="listview1" pagesize="3"> <fields> <asp:nextpreviouspagerfield buttontype="image" firstpagetext="" lastpagetext="" nextpageimageurl="~/images/arrowbtndown.png" nextpagetext="" previouspagetext="" showpreviouspagebutton="false" /> </fields> </asp:datapager> </div> </contenttemplate> </asp:updatepanel> </div> <div id="space"> </div> <div id="rightside"> <div class="description"> <asp:label id="label1" runat="server" text=""></asp:label> </div> <div class="rightspace"> </div> <div class="imagespace"> <asp:hyperlink id="hyperlink1" runat="server" imageheight="320px" imagewidth="480px" cssclass="image1" visible="false" data-lightbox="image"></asp:hyperlink> <asp:hyperlink id="hyperlink2" runat="server" imageheight="80px" imagewidth="120px" cssclass="image2" visible="false" data-lightbox="image"></asp:hyperlink> <asp:hyperlink id="hyperlink3" runat="server" imageheight="80px" imagewidth="120px" cssclass="image3" visible="false" navigateurl="~/index.aspx" imageurl="~/images/tortbtn.png"></asp:hyperlink> </div> </div> </asp:content>
the code doesn't work because, $(document).ready
not fire after each partial postback. need use pageload
it.
function pageload() { $('.imageset').hide().fadein(2000); }
documentation: http://www.asp.net/ajax/documentation/live/overview/ajaxclientevents.aspx
Comments
Post a Comment