[Javascript] LightBox click detection

Hassan Schroeder hassan at webtuitive.com
Fri Jun 14 10:49:12 CDT 2013


On 6/14/13 7:46 AM, Tedd Sperling wrote:

> I want to count the number of times a user clicks a LightBox -- how do you do that?

var foo = 0;
$('body').bind('click', function(){ foo = foo + 1; });
/* adjust the above selector as appropriate */

Done :-) However, I'm guessing that to be useful information
that value needs to be available to you, the developer, yes?

The two possibilities that first come to mind are to either
post it back to the server via AJAX or save it to a cookie to
be read on the next request (assuming there is one).

HTH!
-- 
:about => about.me/hassanschroeder
:email  => hassan at webtuitive.com
:twitter => @hassan
:voice  => +1 408-621-3445


More information about the Javascript mailing list