I'm using the Galleria plugin in an AP div that is elastic. Galleria centers and crops itself nicely on page load but doesn't handle resizing so gracefully. If I resize and then reload the page, it looks great, so I'm wondering if there is a way to unload/reload the plugin ONLY on resize?
Well, yes, I know about the resize event... But if I simply fire up the plugin again on resize, it doubles all the images into the existing carousel. I'm wondering if there is a generic way to unload whatever Galleria has loaded, BEFORE restarting.
Isaac Lubow
2010-06-28 15:58:13
You could remove the old element from the DOM.
SLaks
2010-06-28 16:10:53
+1
A:
if the galleria plugin has a destroy method, use that. but if not, maybe you could try clearing the HTML to it's state before the plugin was originally loaded: effectively resetting the galleria's parent element to empty. maybe use something like
$(window).resize(
$('#galleria-parent-element').html('');
//reload galleria plugin to fresh state
);
jordanstephens
2010-06-28 16:11:01