Nano Scrollbar

The documentation for the Nano Scrollbar Module is broken into relevant sections below. It is recommended that you follow the installation instructions as a first step.

Neat Scrollbar

The documentation for the Neat Scrollbar Module is broken into relevant sections below. It is recommended that you follow the installation instructions as a first step.

Setting up jQuery Update for Foundation

The Zurb Foundation base theme requires jQuery 1.7+ to work. Thankfully, we have the excellent jQuery Update module to help out with that.

Installation

Download the theme from the project page and install and enable it.

Configuration

Please refer to the attached screenshot for reference on the settings form.

9. Simple Drupal AJAX load with jQuery and delivery callback

Most of AJAX code in the Drupal documentation focus on traditional json/_get() applications, which require json manipulation on information on arrival at client side.

Using jQuery.load() function, with only a single line of JavaScript code you can load from an URL address HTML code that will render directly on target element on your site.

But the real trick here is to get only the piece of HTML you need instead of rendering a whole page with header, footer and every element that renders with your content.

Here is where a not well documented argument on hook_menu comes in action.

The 'delivery callback' function manipulates the hook_menu output by default using drupal_delivery_html() which returns a full HTML render page.

What we need to do is define our own delivery callback function returning just the HTML information we want to render via AJAX on client side.

The code will look like this:

1. Define a link to execute the AJAX call:
<a class="btn" href="#" onclick="myModule_ajax_load()">Ajax Test</a>

jQuery coding standards

Prefix variables that point to jQuery objects with a dollar sign($)

In any part of your code it should be easy to understand which variables are jQuery objects and which are not.

Incorrect

Comparison of Lightbox-type modules

There are many "box" scripts freely available on the net. To get an initial idea of which box is suitable for you, http://planetozh.com/projects/lightbox-clones might help you to pick some candidates.

There are various modules in Drupal which provide "lightbox" type functionality. These modules usually use JavaScript to overlay images on the current page when clicked upon, which has the advantage of being able to show users the large version of a thumbnail image while keeping them on the same page. However, there are a number of these modules available, each quite similar but some have more features, while others are more lightweight or have better browser support.

This article attempts to do a comparison between these modules to allow you to choose which one best suits your needs. For the purposes of this comparison, the "lightbox" type functionality where content can be displayed in a container overlayed on the current page, whether it be for images, iframed content or videos, shall be referred to as a "lightbox".

The Overview section is a few years out of date (written at the time of Firefox 3.x and IE 7) with the exception of the Module Overview table which is current as of May 2012. The Available Modules section is also current as of May 2012.

This article was written by the current maintainer of the Lightbox2 module but aims to provide an unbiased and fair comparison.

Subscribe with RSS Subscribe to RSS - jquery