cementedmind / jquery-load-json

Automatically exported from code.google.com/p/jquery-load-json
0 stars 0 forks source link

Unique selectors #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Adding jQuery callbacks on generated HTML

What is the expected output? What do you see instead?
I am using a <img> template with class n id as "imgUrl", when I do a 
$("imgUrl").slideToggle(); only the first img gets the event. How should I 
identify each element other than using .next()?

What version of the product are you using? On what operating system?
1.1

Please provide any additional information below.

Original issue reported on code.google.com by starmo...@gmail.com on 3 Jun 2011 at 1:54

GoogleCodeExporter commented 8 years ago
If I understand this right you have attached some event handler to img in the 
template and it does not work for the generated elements just for the firts 
prototype element?
First could you make sure that you apply event AFTER you call loadJSON?
Maybe your event handler is attached to the template where you selector 
initially finds just a first img element and ater that moment you autogenerate 
other elements however later there is no JQuery command that bind event to the 
generated elements.
Other option would be to use live function instead of the standard bind.
Is there any live URL where I can see this?

Original comment by joc...@gmail.com on 4 Jun 2011 at 10:46

GoogleCodeExporter commented 8 years ago
I will assume that this can be closed. please reopen it with additional 
information if you have same problems.

Original comment by joc...@gmail.com on 24 Sep 2011 at 11:22