On 5/11/11 11:47 AM, Dave Crumbacher wrote: > I am using the jQuery Expander plugin (http:// > plugins.learningjquery.com/expander/) to limit the length of certain > text objects in my exhibit. I am currently doing this in one of > multiple views I have in my exhibit. I have found that if I configure > the exhibit to show the view with the expander-applied text object as > default, it works fine. However, if it is not the default view, it > does not work when switch over to that view. I'm guessing the > expander plugin only works if the text object it is applied to is not > hidden. Is there a way to get a handle on when an exhibit view is > changed so I can apply the expander plugin at that time? Thanks.
Hi Dave, I think the issue is that views aren't actually instantiated when they're not visible, so when you switch a view, any binding you initially did disappears with the deleted DOM objects. If they aren't visible at all initially, there's nothing to bind to. So you would want an event hook of some sort to know when the view changes, to run the plugin's methods on available objects. Not only isn't there an event or handler to hook into, the existing click handler that changes views is greedy and cancels out all other attempts to bind to a click on the new view. It's a known issue. I haven't managed to find an elegant way to work around it (which doesn't preclude there being one). Hacks I've resorted to in the past include redefining Exhibit methods or hooking into onmouseout. You could also try hacking up jQuery: http://stackoverflow.com/questions/1225102/jquery-event-to-trigger-action-when-a-div-is-made-visible You may also want to check if the plugin still functions as expected after facet selection, particularly text queries. If you need more help, putting a sample somewhere we can see it would be useful. -- 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.
