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
When using jQuery v1.5.2, the code works correctly.
When I move to jQuery v1.7.2, the code fails, and gives a "Too Much recursion" error. This also appears to happen when I use jQuery 1.6.2
Does anyone have a workaround for this?
I did find an (updated?) version of splitter.js at https://bungeni-exist.googlecode.com/svn-history/r188/xq-framework/trunk/db/framework/assets/bungeni/scripts/splitter.js but this doesn't appear to solve the problem.
Any advice would be appreciated.
I was experiencing this same issue. After looking around in the splitter.js file for a while, I came across this section of code:
The "yo dawg" reference was the dead giveaway :)
Sure enough, after debugging it in Chrome, there is excessive recursion in this particular event handler function. The developer who wrote it attempted to resolve the issue, but for some reason the newer version of the JQuery library does not work as expected, and the escape condition is never met. From what I can tell, this particular piece of code is only used during page load to set the initial position of the splitter. I found that the splitter was still usable aside from the stack overflow, and the only reason I noticed the problem was because my javascript code after initializing the splitter wasn't running. If you have time, see if you can find out why this part of the code isn't working and post a fix. If you're in a hurry and don't mind duct-tape, put a try catch around the line of code where you call the .splitter() function. It seems to work fine in both Chrome 19 and IE 9.
There's an updated fork of jQuery.splitter that works with jQuery 1.8 (also 1.9 if you restore
jQuery.browser
) at https://github.com/e1ven/jQuery-Splitter.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-
UI-Layout stays up-to-date and does "splitting" and alot more, and is fairly easy to use.
Extremely Minimalist Example
Complex Demo
Advanced Complex Demo
I ran into the same problem in the process of upgrading a site to jQuery 1.8. After a bit of debugging and poking around in the code, it seems to me there were two issues: the resize event was getting triggered unnecessarily in a few places, and it was getting triggered on the splitter before the splitter's resize event handler had been setup. I switched the order of the last two chunks of code to make sure the splitter's resize event handler gets set up first and tidied up a few lines. It now looks like this:
Also, make sure you remove
from the reSplit function. I've uploaded the whole thing to a GitHub repo if you want to see it all in one place.