Why no onPhotoShow in filmstrip view?
jfriend
Registered Users Posts: 8,097 Major grins
I'm trying to do some JavaScript customization that needs to put something into the page that is specific to the main image being displayed. I have it worked for nearly all views, but not in the filmstrip view.
For some reason, the filmstrip view loads a new image into the page without reloading a new page (e.g. via Ajax and DHTML), but it doesn't call onPhotoShow subscribers like the Smugmug view does.
onPhotoShow works great in the Smugmug view for letting a Javascript know when a new image has been loaded dynamically. Why isn't it being used in the filmstrip view which is doing the same thing? Is there some other way to know when a new photo has been loaded in the filmstrip view?
For some reason, the filmstrip view loads a new image into the page without reloading a new page (e.g. via Ajax and DHTML), but it doesn't call onPhotoShow subscribers like the Smugmug view does.
onPhotoShow works great in the Smugmug view for letting a Javascript know when a new image has been loaded dynamically. Why isn't it being used in the filmstrip view which is doing the same thing? Is there some other way to know when a new photo has been loaded in the filmstrip view?
--John
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
0
Comments
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Cheers,
David
SmugMug API Developer
My Photos
It would be great of JT or Lee could drop by sometime and let me know how this works or is supposed to work.
The filmstrip view does rewrite the main image in the page without changing the URL or reloading a page (kind of like the Smugmug view). No other views do that.
Therefore, it would be real handy to have a JS hook whenever the main image changes. onPhotoShow is such a hook in the Smugmug view and it would be trivial to call onPhotoShow.fire to trigger the subscriber notification. Or, I could live with some other mechanism, though that would be a lot less consistent for JS developers.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
- When it's first loaded when a new page in the Smugmug view comes up. I'd like to see the array after it's loaded, but before the page has been drawn so other events are too late
- When it gets changed because the window has been resized enough to cause a new image size or new thumb layout to be chosen
Right now, I've subscribed to onPhotoShow, but that is called way more often than I need (like every click on a thumb) and it's a lot of wasted Javascript execution for me to try to figure out if parts of the photoInfo array have changed every time onPhotoShow is called. The first time it's called is also a little late for what I'm trying to do when the page is first loaded. Thus, some sort of YUI event that got called anytime the photoInfo array was reloaded (via an ajax RPC call) would be perfect for my application.Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question