JSSOR滑块窗口调整内存泄漏

时间:2014-11-17 15:52:52

标签: jquery memory

在调整浏览器窗口大小时,使用我的JSSOR滑块实现来解决内存泄漏问题。任何解决方案。

var jssor_slider1 = new $JssorSlider$("slider1_container", options);
//responsive code begin
//you can remove responsive code if you don't want the slider scales while window resizes
function ScaleSlider() {
    var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth;
    if (parentWidth)
        jssor_slider1.$ScaleWidth(Math.max(Math.min(parentWidth, 800), 300));
    else
        window.setTimeout(ScaleSlider, 30);
}

ScaleSlider();

if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) {
    $(window).bind('resize', ScaleSlider);
}

0 个答案:

没有答案