[ 2 posts ]

satyakaran

  • Joined: Thu Sep 15, 2011 1:36 am
  • Posts: 1
  • Offline
  • Profile

How to call custom module of YUI3 from an event

Post Posted: Thu Sep 15, 2011 1:43 am
+0-
Hi

I have created a module using this syntax:

YUI.add('flickr-carousel', function(Y) {});

and I can use this using YUI.use (..).

My code is working on carousel. The problem I am facing is :

My carousel has pagination. When I use next button then new images on next page does not have my event tied from custom module.
and I cannot modified that next, prev button call.
I am thinking of attaching event call for next, prev button. But how to call the YUI custom module without calling YUI.use() again.

Can I do something from the module itself to tie the module code to next,prev event so that when next/prev button is clicked then new images will have the event created and attached from my custom module!

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: How to call custom module of YUI3 from an event

Post Posted: Thu Sep 15, 2011 3:32 am
+0-
Hello satyakaran.

I think you described the solution.

You may attach another handler for next, prev buttons.
Inside the handler you fire a custom event.
The custom events are subscribed in the module.

The guide for the custom events:
http://yuilibrary.com/yui/docs/event-custom/

Hope that helps,
IceBox
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum