Hover Card

Dependencies

Installation

The Hover Card module is very similar to other Drupal modules which require Libraries Module to use for the 3rd party code integration. Hence, for installation of the Hover Card module please follow the below-mentioned steps:

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

var foo = $('.foo');
var object = { bar: $('.bar') };

Correct

Pages

Subscribe with RSS Subscribe to RSS - jquery