It looks like your first issue is because the jquery uses the selector .theDiv and a class theDiv is added to each item in the repeater. If you have a data key that is unique to each item then use it to append to the class name and the selector. This way
the jquery you call from the item will have a selector unique to that item.
Not sure what you are trying to do with the second issue. Perhaps if you explain again, I might be able to help.
i want fadeout (btn_phone) to apper the phone numper <span ><%#Eval("PHONE_NO1")%></span> it work but when click any one all dive that have (btn_phone) fadeout i want fadeout just i press on it only
second: (btn_email) i use fancybox to popup ontact-agent.aspx by this code
Hi Man
i'm sorry but yesterday i created new thread but there's no one can help me to found solve can you plz check this thread and give me what you think
i wondered you have time to response me really thanks you :)
this is the link
http://forums.asp.net/p/1801820/4972545.aspx/1?FancyBox+Resize
Kindly mark this post as "Answer", if it helped you.
hi my friend how are you ,
i wish to be good
please why you don't respond me
i'm really stuck no one can help me about this question
i asked same question another place and have same result
i don't know why
i have idea can i close the first then open the second if the resize is very big problem
but also i cant do it
Kindly mark this post as "Answer", if it helped you.
modaloda
Member
124 Points
72 Posts
Error when using ListView
Mar 24, 2012 01:43 PM|LINK
I have listview that repeat (div id="Box_agent"). That div contains two links
First link for fade it self Contact by phone
<a class="btn_phone theDiv" id="fadeout" onclick="MM_callJS('$(\".theDiv\").fadeOut(1500)')">Contact by phone</a>
And second for open popup using fancybox Contact by email
<a class="btn_email iframe" id="cpop" href="contact-agent.aspx?agent_id=<%#Eval("AGENT_ID")%>">Contact by email</a>
Now the problem is that when (div id="Box_agent") repeat by no.of data get from database ex: 6 div **generated by listview**
1_onclick Contact by phone all fade out not just one I click on it
2_only first one Contact by email that apply popup but others not apply popup
JQuery listview asp.net
RichardY
Star
8376 Points
1573 Posts
Re: Error when using ListView
Mar 24, 2012 02:09 PM|LINK
It looks like your first issue is because the jquery uses the selector .theDiv and a class theDiv is added to each item in the repeater. If you have a data key that is unique to each item then use it to append to the class name and the selector. This way the jquery you call from the item will have a selector unique to that item.
Not sure what you are trying to do with the second issue. Perhaps if you explain again, I might be able to help.
JQuery listview asp.net
modaloda
Member
124 Points
72 Posts
Re: Error when using ListView
Mar 24, 2012 05:26 PM|LINK
thnx my frind for your help
i will explain what i mean
i have listview that repeat the div by the numper of record i get from my query
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource3"> <ItemTemplate> <div id="Box_agent"> <div class="details-agent"> <h3><%#Eval("NAME_E")%></h3> <p><%#Eval("DETAILS_E")%></p> <p><a class="more" href="agent-listing.aspx?agent_id=<%#Eval("AGENT_ID")%>">View my <%#Eval("agent_unit_count")%> listings »</a></p> </div> <div class="icon"> <div class="thumb"> <asp:Image ID="Image1" ImageUrl='<%# Eval("AGENT_LOGO", "~/{0}") %>' runat="server" width="178" height="98" /> </div> <a class="btn_phone theDiv" id="fadeout" onclick="MM_callJS('$(\".theDiv\").fadeOut(1500)')">Contact by phone</a> <div id="m" ><span ><%#Eval("PHONE_NO1")%></span></div> <a class="btn_email iframe" id="cpop" href="contact-agent.aspx?agent_id=<%#Eval("AGENT_ID")%>">Contact by email</a> </div> </div> </ItemTemplate> </asp:ListView>i want fadeout (btn_phone) to apper the phone numper <span ><%#Eval("PHONE_NO1")%></span>
it work but when click any one all dive that have (btn_phone) fadeout i want fadeout just i press on it only
second: (btn_email) i use fancybox to popup ontact-agent.aspx by this code
$("#cpop").fancybox({ 'transitionIn': 'elastic', 'transitionOut': 'elastic', 'speedIn': 600, 'speedOut': 200, 'width': 770, 'height': 460, 'padding': 0, 'margin': 0, 'scrolling': 'no', 'overlayShow': true });problem : (btn_email)
onclick (btn_email) First div, which works only ,but all other no
<div id="gt-res-content" class="almost_half_cell"> <div dir="ltr">I'm sorry to explain the details in the stretching</div> </div>urenjoy
Star
11997 Points
1797 Posts
Re: Error when using ListView
May 08, 2012 09:03 AM|LINK
For first, Try this instead of .thDiv:
onclick="MM_callJS('$(\".theDiv\").fadeOut(1500)')" ToFor Second, Use class instead of ID
modaloda
Member
124 Points
72 Posts
Re: Error when using ListView
May 08, 2012 02:06 PM|LINK
ohhh man
Where are you from time :)
thank you
the second worked like what i need
but the first still don't work i will show to you my code to can help me
jquery script
<script type="text/javascript"> jQuery("#fadeout").click(function () { jQuery(".theDiv").fadeOut(4000, function () { }); }); function MM_callJS(jsStr) { //v2.0 return eval(jsStr) } </script>okay and HTML
<a class="btn_phone theDiv" id="fadeout" onclick="MM_callJS('$(\".theDiv\").fadeOut(1500)')">Contact by phone</a> <div id="m" ><span ><%#Eval("PHONE_NO1")%></span></div>i try to do what you said unfortunately still not working what you think
urenjoy
Star
11997 Points
1797 Posts
Re: Error when using ListView
May 09, 2012 04:55 AM|LINK
Try following if you can ignore MM_callJS:
<a class="btn_phone theDiv" id="fadeout" onclick="$(this).fadeOut(1500)">Contact by phone</a> <div id="m" ><span ><%#Eval("PHONE_NO1")%></span></div>modaloda
Member
124 Points
72 Posts
Re: Error when using ListView
May 09, 2012 07:25 AM|LINK
modaloda
Member
124 Points
72 Posts
Re: Error when using ListView
May 10, 2012 01:53 PM|LINK
Hi Man
i'm sorry but yesterday i created new thread but there's no one can help me to found solve can you plz check this thread and give me what you think
i wondered you have time to response me really thanks you :)
this is the link
http://forums.asp.net/p/1801820/4972545.aspx/1?FancyBox+Resize
modaloda
Member
124 Points
72 Posts
Re: Error when using ListView
May 13, 2012 07:15 AM|LINK
hi my friend how are you ,
i wish to be good
please why you don't respond me
i'm really stuck no one can help me about this question
i asked same question another place and have same result
i don't know why
i have idea can i close the first then open the second if the resize is very big problem
but also i cant do it