Forums » Help & Troubleshooting



integrate clicky into Fancybox

Hi,

I'm redoing my website, and will now use fancybox :
http://fancybox.net/

how can I alter this script so each time someone click next/previous image it log it for clicky ?
I did this with lightbox, but the code was a lot more commented and clear (variable names etc).

If anyone ever done it, thanks to put me in good direction.

Posted Sun Jan 5 2014 3:23a by KiboO***


Ok, if someone is interested :

Open jquery.fancybox.pack.js :

///TOP (global variable):
var clickit = 0; //initialize first uncounted clicky

///line 165:
clickit = 0; //initialize first uncounted clicky at reopening



///line 451 into _afterLoad function:
var a = b.coming,
d = b.current,
e, c, k, g, h;
b.hideLoading();


// Clicky log stats
// clicky.log( href, title, type )

var clickyhref = a.href;
var clickytitle = a.title;
// do some manipulate on clickytitle if you want

if (clickit == 1) {
clicky.log(clickyhref, clickytitle, 'download');
}
clickit = 1;

// Clicky END


upload jquery.fancybox.pack.js and enjoy !

Posted Mon Jan 6 2014 3:07a by KiboO***


Hi KiboOst

thanks for sharing the solution! Fancybox looks awesome.

Ed

Posted Mon Jan 6 2014 10:01a by edyod***


You must be logged in to your account to post!