Re: LightBox click detection

From: Date: Sat, 15 Jun 2013 18:07:43 +0000
Subject: Re: LightBox click detection
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-321411@lists.php.net to get a copy of this message
Tedd Sperling <tedd@sperling.com> wrote: > It's Friday so I am allowed to ask odd questions. W00T! Friday! > Here's the problem -- I need to count the number of times a user activates a LightBox -- > how do you do that? > > Here's a LightBox Example: > > http://www.webbytedd.com/c2/lightbox/ > > All the javascript is there (jQuery et al). > > Ideally, I would like to have a php/javascript combination that would: > > 1. Detect when a user clicked the LightBox; > 2. Pass that value to PHP so I can keep count. > > Any ideas? First off, do you have the javascript code available in an unsquished form? That would mean I could read it. Not knowing whether your JS code or Lightbox has any hooks that you can take advantage of, I'd steal the onclick event from those images that start lightbox, fire off an AJAX request and ignore the return, then fire the lightbox event handler.

« previous php.general (#321411) next »