Posts Categorized: Javascript

Scriptaculous Sortable Create onUpdate Event Not Firing

I’ve been having trouble with a Scriptaculous sortable object that wasn’t catching the onUpdate function I’d assigned. In this case, I was using an UL for the parent with LIs inside. After digging into the code, I discovered that there are several criteria that must be for the actual items that are going to be sortable, or else the event won’t fire. These are: (more…)

Javascript Event Handling With prototype’s bind()

In Javascript, the native event handlers have the infuriating problem of not allowing the user to pass in additional parameters. Normally, when you want to handle an onclick or the like, you can only reference this (meaning the event itself). So everything you want to handle, you have to create a completely isolated custom function for. Not at all efficient. The Prototype library provides a solution. (more…)

Scriptaculous: Simultaneous Animation Effects

I remember my first programming class. I was seven. For the life of me, I could not make that damn turtle draw a star while playing music at the same time to save my life (or my grade). This is generally just as painful and traumatic to do in Javascript as it is in Logo.

The thing that makes Scriptaculous totally amazing is native simultaneous effects go right here. Meaning, you can do a shape tween and an opacity change all at the same time, no jerkiness or anything. You can just pass in an array of effects to render, and it does them all at the same time.

Scriptaculous: Table issues and Forms

So I’ve been playing with Scriptaculous a bit, and doing some debugging. I have a table, in which certain rows would should appear when a link is clicked. I’ve got it set with a display:none by default and I’m using Effect.SlideDown to have it appear. Now due to how display and opacity on tables, trs, and tds are handled by just about every browser, there were several unexpected results.