开发者

How to re-load a jQuery plugin on page resize?

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?


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
);


Handle the resize event.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜