Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Drupal and jQuery

16/04/2025, by Ivan

What is jQuery?

jQuery is a wonderful JavaScript library that allows you to create great web effects with just a few lines of code. As stated on the official jQuery website:

"jQuery is a JavaScript library whose motto is: writing JavaScript code should be fun. jQuery handles common, repetitive tasks, cleans up layouts, and keeps code short, beautiful, and understandable."

You might be thinking, "Why not use another JavaScript library?" Sure, go ahead—but just try how jQuery is both simple and powerful, even if you've used MooTools or Prototype before.

Why should I use jQuery?

It's very simple. Just take a look at some jQuery code and you'll see how easy it is, how jQuery fits powerful actions into just a few lines, and how graceful those lines look.

It all became clear to me one fine day when I encountered some code written in jQuery. I was browsing RSS feeds and came across a blog post about design that included an example of JavaScript code using jQuery. Honestly, the code was cross-browser, and the concept of jQuery was something new to me at the time.

What can be said about jQuery code?

The code looks stunningly simple. I've never seen anything easier. It's eye-opening. I started reading the documentation and was amazed at how much JavaScript code can be simplified.

When can you use jQuery?

You can use jQuery anytime because jQuery is already built into Drupal:

  • This tiny library provides powerful control over the Document Object Model.
  • It requires very little effort to accomplish a lot.

Or:

  • For quick access via AJAX.
  • Without bloated code full of hacks (and without worrying about code becoming outdated).
  • To easily set up beautiful animation effects.

If you need animations—transitions, show and hide, slide out, highlight, drag and drop—all this can be done in just a few lines of code. It's unlikely you'd get it done this fast with Prototype.

I'm ready to start writing in jQuery!

Just get started. jQuery is already integrated into Drupal—just attach a js file to your theme and start writing jQuery code. What should you write? More on that in the next articles...