Using floatbox to call function

Page: 1

Author Post
Member
Registered: Sep 2013
Posts: 6
Hi,

Is it possible to make floatbox call an function, when clicked on an <a> tag? Like this:

<a href="myFunc();myFunc2();">click me</a>
Administrator
Registered: Aug 2008
Posts: 3382
The question is very vague.

What you have quoted won't work at all. The href is what the link links to. To call a function you could place the code in an onclick attribute. This has nothing to do with Floatbox. You can learn about href and onclick attributes from pretty much any online HTML authoring tutorial or reference.

Floatbox has some callback functions that can be defined as options, such as beforeBoxStart, afterItemStart, etc. These are described in the "Event Callbacks" section of the API Reference.
Member
Registered: Sep 2013
Posts: 6
My bad, let me try again:

<a href="javascript&#058;void(0);" class="alt floatbox" data-fb-options="afterItemStart:`myFunc();`">


It opens the floatbox, but calls the function afterwards in another popup. Should this not work correctly and be shown in floatbox?
Administrator
Registered: Aug 2008
Posts: 3382
You're welcome to show me a live page online that illustrates what you are trying to do.

Functions are not called in popups. They execute in the javascript engine attached to the current window object (browser page). Similary, javascript functions are not shown anywhere, in a floatbox or elsewhere. HTML content shows.

While you are welcome to show me what you are doing, I must caution that I won't get to heavily involved in co-authoring your javascript with you.

Page: 1