Splitter.js won't work with new versions of jQuery

前端 未结 5 1922
独厮守ぢ
独厮守ぢ 2020-12-30 04:48
I\'m using Splitter.js in a project.

The code is from http://methvin.com/splitter/ The specific JS is at http://methvin.com/splitter/splitter.js

5条回答
  •  猫巷女王i
    2020-12-30 05:40

    Per Steven Hunt's answer, I have a workaround by adding try/catch blocks, and removing a recursive call.

    Replace the block below (from around line 149ish) with this modified version-

            try
            {
    
              if ( opts.anchorToWindow ) {
                // Account for margin or border on the splitter container and enforce min height
                splitter._hadjust = dimSum(splitter, "borderTopWidth", "borderBottomWidth", "marginBottom");
                splitter._hmin = Math.max(dimSum(splitter, "minHeight"), 20);
                $(window).bind("resize", function(){
                    var top = splitter.offset().top;
                    var wh = $(window).height();
                    splitter.css("height", Math.max(wh-top-splitter._hadjust, splitter._hmin)+"px");
                }).trigger("resize");
    
              }
              else if ( opts.resizeToWidth && !$.browser.msie )
                $(window).bind("resize", function(){
                    splitter.trigger("resize"); 
                });
              }
            catch(err)
            {
            }
    

提交回复
热议问题