I have a recordset loop in ASP, and when someone click in some row of this loop table, it launchs a fancybox iframe with some detailed information, when I click in the first item of the loop table the launchbox opens fine, but when I click in any other row below, it does not work. I believe the problem is something about the ID value (pergunta) of the link , I'm using the same ID to all rows to launchl the fancybox iframe, but I don't know how could I fix this, anyone may help?
This will create each row with a new iD e.g. pergunta0, pergunta1, pergunta2 etc.
I'm not that familiar with jQuery though, but from what I've seen there is probably some method of binding your script to each hyperlink within the divs that have class texto-geral-2.
That will work indeed as that searched for all elements with that class. However it is still not a good idea to use duplicate ID's.
marcoloppo
ASKER
Hello,
Thank you Seo Expert, I used the code below and it worked, but it's still with duplicated classes (anymore IDs), besides the code is working fine with this adaptation, what are the problems I can have with it?
Onthrax, you showed how I could do the differents IDs to each row, but about the jquery code, I also have to make any change in the code to it works, no?
To give an unique ID do something like this:
<%
Dim i
i = 0
while RS3.eof = false
%>
<div class="pane spam">
<h3 class="destaque-laranja-1"
<p class="texto-geral-1"><%=R
<p class="texto-geral-2"><a id="pergunta<% =i %>" href="ver-resposta.asp?cod
</div>
<%
i = i + 1
RS3.movenext
wend
%>
This will create each row with a new iD e.g. pergunta0, pergunta1, pergunta2 etc.
I'm not that familiar with jQuery though, but from what I've seen there is probably some method of binding your script to each hyperlink within the divs that have class texto-geral-2.