jQuery Galleriffic Plugin History Update

Using the Galleriffic version 2.0.1 you will find it incompatible with the 2010-09-11 jQuery History plugin. It currently only works with the 2009 history plugin version.

When you insert the pageload function and its calls into your HTML, update it to the following. Lines 3 and 15 are updated.

// Initialize history plugin.
 // The callback is called at once by present location.hash.
 $.history.init(pageload);

// set onlick event for buttons using the jQuery 1.3 live method
 $("a[rel='history']").live('click', function(e) {
 if (e.button != 0) return true;

 var hash = this.href;
 hash = hash.replace(/^.*#/, '');

// moves to a new page.
 // pageload is called at once.
 // hash don't contain "#", "?"
 $.history.load(hash);

return false;
 });

Then update jquery.galleriffic.js:
Line 495:

$.history.load(String(imageData.hash));

Line 868:

if (this.enableHistory && !$.history.init)
Advertisements