Is there a way to do something along the lines of executing our own javascript code with an onClick event?
In my particular case, I would like Google Analytics to track each time someone watches the video on our home page, which is in a floatbox. I tried adding onClick="pageTracker._trackPageview('/index.php/played_movie.flv')" to the anchor tag that opens the floatbox, but this seems to fail most of the time (confirmed by changing the onClick action to alert('clicked') ).
It would be nice if there were a callback function to execute our own code when someone opens or closes a floatbox....
Thanks,
Mike
onClick Javascript events
Page: 1
Author | Post |
---|---|
myquealer
|
#1 Thu Jan 22, 2009 8:45 pm
|
Guest | |
#2 Fri Jan 23, 2009 11:35 am
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
Yup, floatbox takes over the onclick action, stomping on anything you might have set up there. So, for floatboxed anchors, you should assign your javascript action to the onrelease event. This will stay intact.
Callbacks for different floatbox actions (start, end, change) will be implemented in the next release. Stay tooned.... |
myquealer
|
#3 Fri Jan 23, 2009 10:14 pm
|
Guest |
Thanks for the reply. Of course, I should have thought of onRelease....
Instead I hacked Floatbox and added onOpen and onClose options which eval the javascript they are set to when opening and closing a floatbox. This is probably a big security hole. To close it, at least partway, I disabled Floatbox reading options from the query string. |
Page: 1