Hi Ora, I think it is common to override the showBubble action. -- and I'd like to make it even easier and more straight-forward to do so. I override the showBubble action on every Timeline I build.
You shouldn't have to change your showBubble due to changes in Timeline -- or at least not very often at all. If you want to minimize the changes caused by your project's changing requirements, then the trick is to figure out how to be more generic when creating your bubble content. For example, in one of my projects, the bubble content comes from the server as part of the event data. That way the content of the bubble is entirely controlled on the server and can be changed (or made event-specific) without changing the Timeline js. HTH, Larry ________________________________ From: ora <[email protected]> To: SIMILE Widgets <[email protected]> Sent: Sunday, April 5, 2009 1:54:20 AM Subject: Re: overriding the click on link behavior Hi Larry, The problem is that the href that are created by the Simili in the bubble do not have an id. So the only way I see is to override the entire showBubble and add the link an id that can be referenced for the onClick. I dont like this idea very much because it means I override the showBubble action in a very specific way that would probably have to change with every version upgrade I do. Do you think otherwise, is there a nicer solution I am missing? Thanks Larry Kluger wrote: > Hi Ora, > > Add an onclick listener to the "a" element (the link) and change the href > attribute to > You can google for this type of Javascript help. > > Here's how I do it in one of my scripts: > Note: this is a private object that holds all of the functions and data of > the script. > > this.dom = dom: YAHOO.util.Dom; // I use YUI, others use jQuery, or > Prototype or .... > a_el = this.dom.get(my_id); // my_id is the id of the "a" element > a_el.href = 'javascript:void(0);'; // reset the href > > YAHOO.util.Event.addListener(a_els "click", this.on_click, my_id); // > this.on_click is the callback function that is invoked when the user clicks > on the link, > } > > If the link is within a Timeline bubble, then you'll need to create the > bubble's content yourself. > > > If you want the special action to happen instead of the bubble being shown, > then the easiest way would be to overload the show bubble function -- have it > either do something special or show the bubble, depending on the event's > details. > > Larry > > > > > ________________________________ > From: ora <[email protected]> > To: SIMILE Widgets <[email protected]> > Sent: Thursday, April 2, 2009 11:21:24 AM > Subject: overriding the click on link behavior > > > Hi, > > I dont know if this is an easy one but.... > I want that everytime the link of a certain event is clicked to do my > own action, e.g run some kind of javascript for opening this url in a > special format (instead of really opening the url in a new browser). > > know of a nice way to do it? > > Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en -~----------~----~----~----~------~----~------~--~---
