0

i am using this gallery plugin but i can't access the elements created on-the-fly by the plugin. what can i do??

Thanks folks!!

eos87
  • 8,961
  • 12
  • 49
  • 77
  • 1
    What do you mean, "access"? How are you trying to access the elements? What code have you used so far, and how do you know it's not working? – Pointy Jul 31 '10 at 01:02

2 Answers2

1

.live() is your friend but this is a plugin so it is probably not applicable.

attaching events to objects in the dom (like $('.box img').click... ) will not be attached to any new elements....

not used that plugin but perhaps there is a 'refresh' method similar to .sortable that will ensure any new element to be included has the correct event handlers attached

Ian Wood
  • 6,515
  • 5
  • 34
  • 73
1

In Galleria, you can access each DOM element using f.ex this.get('container') or this.get('stage') in the extend option.

You can also use f.ex this.$('thumbnails') that will return the element in a jQuery context.

David Hellsing
  • 106,495
  • 44
  • 176
  • 212