User login


Define and Use a JQuery Plugin as a Helper Function for Drupal JavaScript

Here's the basics of defining and using a JQuery plugin within the context of Drupal.

This is definitely not the best and highest use of a plugin, and may in fact be a downright abomination-- this isn't a plugin that really works outside the context of the code it is written for, and certainly not outside Drupal. But it was a clean way to abstract out 42 lines of code, so here it is, for the enjoyment of all.

The first part here is simply how to call JQuery from Drupal, the second part is the plugin.

JQuery select elements without a given class or ID

Anywhere you can use .classnamehere as a Jquery selector, you can use:


Looping through a set of IDs to set JQuery triggers on that pass a parameter to a function, such that it works

Corrected JavaScript to work for first variable in list (product) as well as second (rental).

Syndicate content