1

I run fancybox beta v.3 and I have a gallery that I want to log views of. Every time a user opens the fancybox or click on another thumbnail/use the arrows to navigate to another gallery item I want to log it by sending an ajax request with ID to MySQL via PHP.

I know how to do all of the logging, but I need help with where I will put my ajax code in the fancybox code. Is there a simple way of doing this?

Thanks for help!

SeaBass
  • 1,584
  • 4
  • 20
  • 46

1 Answers1

0

what you can do is add into your anchor tags for your images something like onclick="myJsFunction(id)"

Then in your area with your fancy box jquery script you would create your ajax function named whatever you added in your onclick event and pass your parameters much like you would with a php function/method to your destination url with your php code that will add your entries to your database

KyleMassacre
  • 362
  • 3
  • 14