Topic: Scriptaculous

jQuery 1.3: Plugins continue to migrate to the core

jQuery logo

jQuery celebrated its third birthday Wednesday with the release of the brand-new 1.3 version. This latest release includes a bunch of cool new stuff which has already been discussed to death elsewhere. To me, however, the most interesting aspect of jQuery 1.3 is the movement of former plugin functionality to the core library.

Live events are a new twist on the venerable, and indispensable, Live Query plugin, while the upgraded, more granular effects queues were previously tackled by add-on authors. IMHO, this kind of migration is A Good Thing, providing greater parity with other core JavaScript and effects libraries (such as Scriptaculous's FX queue) while offering compelling feature differentiation (event binding throughout the full lifecycle of an Ajax page).

Scriptaculous Drag and Drop with AJAX Update Fix for IE

If you have used scriptaculous to do drag and drop interactions which result in a replacement of the DOM element you are dropping into, you may have noticed that you can only do one drag and drop before it breaks in IE. The problem occurs when you replace a DOM element which is defined as a Droppable; IE will fail because it will still have the original element registered as a Droppable but it does not handle the fact that it no longer exists in the DOM. Firefox and safari have no issue with this, so this is another frustrating IE specific issue.

Fortunately, this problem is easily solved with a single line of javascript.
Continue reading »

Pimp my jQuery: Five plugins to replace the features Prototype and Scriptaculous users expect

jQuery logo

Ajax pros, especially in the Rails world, often know the Prototype and Scriptaculous JavaScript libraries inside and out. When faced with the prospect of writing on top of the competing jQuery framework, they may quickly stumble upon seemingly missing features.

The culprit? jQuery's less-is-more approach, in which advanced or specialized features come via plugins instead of the core library. The greater reliance on single-purpose plugins gives jQuery a lean footprint and a vibrant ecosystem, but they come at a cost. You often must rope in several plugins to accomplish things Prototype and Scriptaculous can do out of the box.

If you want to encourage your team to step out of the Prototaculous mindset, it helps to have a readymade list of plugins that approximate those libraries' core features. At this point jQuery and Prototype approach feature parity, but once Scriptaculous is in the mix, jQuery relies on multiple plugins to keep up with the Joneses. Here's a quick stab at how to trick out jQuery:

Continue reading »

Scriptaculous: Fixing Hover After Highlight

One of the annoying things about the highlight visual effect in Scriptaculous is that it will break your :hover background-color CSS definitions. The occurs because scriptaculous sets the background-color style property of the element to whatever it was set to before the effect began. This behavior would be desirable if you're using inline styles or setting the style property through javascript, but you will run into issues if you're doing it The Right Way™ and using CSS classes and Element.add/removeClassName. Fortunately, there is an easy solution to this problem.

Continue reading »

Topics:

Multiple Column Sorting with Drag and Drop using Scriptaculous

The other day I wanted to do drag and drop between multiple columns using scriptaculous. Allowing this behavior is extremely simple, but out of the box the interaction feels clunky. Here, we'll be going through an example of how to do multi-column drag and drop with scriptaculous.

Enabling multi-column drag and drop just involves setting a single option, but without setting a few other options the dragging will feel jittery and won't allow us to drop on empty areas. Also, interaction with the server will require a small bit of consideration to support persistence of any changes.

Continue reading »

JRails: Scriptaculous on top of JQuery

Prototype and Scriptaculous had their origins in Ruby on Rails before spinning off. There they went head to head with the lighter, leaner JQuery. Now the circle is complete, with Scriptaculous functionality on top of JQuery making its way back into RoR in the form of JRails.

jRails is a drop-in jQuery replacement for Prototype/script.aculo.us on Rails. Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library.

This is certainly good news for folks who do a fair bit of mashing up. Combining two sites or services, one of which uses Prototype and the other JQuery, can be a bit painful.

Technorati Tags: , , , ,

Why Does Scriptaculous Need Prototype?

I've been going through the Scriptaculous effects library in some detail. After grokking all there is to know about effects queues, I was left with one question: why does the effects library have a dependency on Prototype? The dependency could be removed with maybe two dozen lines of Javascript. So, why the dependency?

After having several other frameworks arm wrestle me for the $ identifier, I'd like to drop Prototype at the nearest corner.

Anyhow, I'm working on something involving Scriptaculous now that will likely make me the but of both jokes and death threats. Stay tuned.

Launch: Pathfinder Newsletter

    Get a monthly update on best practices for delivering successful software.

    Subscribe via email


    Subscribe via RSS      RSS icon

Topics

Search

WordPress

Comments about this site: info@pathf.com