On 1/22/11, Daniel Donaldson <d8nieldonald...@gmail.com> wrote: > i'm trying to change the width of the dragged item on stop, which > seems like it should be easy, but when i add a function on the stop > event things get all screwy. > > i've got it on jsfiddle: http://jsfiddle.net/d8nieldonaldson/smYeh/ > > thanks in advance for any help/insights! > I took a look at the source code:
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title> - jsFiddle demo by d8nieldonaldson</title> <script type='text/javascript' src='http://code.jquery.com/jquery-1.4.4.min.js'></script> <script type="text/javascript" src="/js/lib/jquery.lint.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.js"></script> <link rel="stylesheet" type="text/css" href="/css/normalize.css"> <link rel="stylesheet" type="text/css" href="/css/result-light.css"> <script type='text/javascript' src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> END CODE Two different versions of jQuery UI? Looks like a mistake. Is that jsFiddle's doing? You mentioned that things get screwy and I do see some things in that page that are screwy but I'm not sure if they're the same things that you're seeing. So in general, for everybody, myself included, to help get the best possible answer, describe the problem in detail. Mention the browsers and versions that the behavior was observed in. In FF 3.6.13, I noticed slow, heavy, unresponsive, perf along. Releasing a draggable image, there is about a 3 sec pause before the image begins to glide back to its origin. When beginning dragging, I see dimension changes of the UL id="target" from 84px height when no item dragged, to 89px height when there is an active drag. I also noticed the LIs go from position static, when not dragged, to position absolute when dragged. I presume jQuery draggable is doing those things, though I've not looked at it to find out where exactly. The reasons for these things are in the source code of jQuery and jQUery UI. Anyway, try first changing the source code to have jQuery UI just once. TBH, I probably won't look into this much more. If the jQuery team wants others to volunteer take up their slack help their poor users then cleaning up jQuery source code would help. Cyclomatic complexity of jQuery is way too high. As I've previously repeated (too many times) on comp.lang.javascript, jQuery methods are long and complicated. On a whole, jQuery is too interdependent and general. However, the CC can be improved by refactoring to simpler, shorter, more specific methods with fewer options applying SRP to method design. -- Garrett -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com