When are images loaded in new Journal view?
jfriend
Registered Users Posts: 8,097 Major grins
In the new Journal view, it appears that if I run a script with onDOMReady that sometimes the images will not yet be in the page. I tried onPhotoShow (what the Smugmug view uses) and it doesn't fire in the new Journal view.
So, how do I reliably fire a script after the images are loaded into a new Journal page?
FYI, I see lots of new code (SM.Gallery.Manager) which perhaps explains why some timing is different than it used to be. I have scripts that are busted in the new journal view because I don't know how to trigger them after the photos are loaded. Does SM.Gallery.Manager have events that I can hook after the images have been loaded and put in the page?
Why don't you just fire the same event for every single view anytime it's loaded so script writers can just do it the same in every view? The Smugmug view has had onPhotoShow for a long time, but that doesn't fire in other views.
So, how do I reliably fire a script after the images are loaded into a new Journal page?
FYI, I see lots of new code (SM.Gallery.Manager) which perhaps explains why some timing is different than it used to be. I have scripts that are busted in the new journal view because I don't know how to trigger them after the photos are loaded. Does SM.Gallery.Manager have events that I can hook after the images have been loaded and put in the page?
Why don't you just fire the same event for every single view anytime it's loaded so script writers can just do it the same in every view? The Smugmug view has had onPhotoShow for a long time, but that doesn't fire in other views.
--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
I haven't really had anything to do with this new frontend development, but i've just been through the code and found the following events...I'm sure one of these will work for you...
to subscribe to the event...
At this point, it only looks like this is rolled out for the new Journal style...but I'm sure the front end guys are working on that.
Hope this helps.
Cheers,
David
SmugMug API Developer
My Photos
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Also, please pass on that all views should have the same set of events so customizing doesn't have to use different notification mechanisms for every view type.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
John,
I believe that Journal is the first to get this stuff...and will filter down to other styles as they get revised.
I'll check with them about the other stuff.
Cheers,
David
SmugMug API Developer
My Photos
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question