fb.start a gallery from outside the gallery

Page: 1

Author Post
Member
Registered: Apr 2015
Posts: 3
Hi

I have a gallery of complex elements, each taking their content from hidden DIVs created elsewhere:

<div id="detail" class='floatbox' data-fb-options="group:demo1">
<a href="#d1"></a>
<a href="#d2"></a>
<a href="#d3"></a>
</div>

I want to be able trigger this floatbox gallery from a click event elsewhere on the page. What is the source for the fb.start() call in this case?

I've tried "detail", "#detail" and "demo1" but none of them work.
If I use "#d1" it works, but it only displays this single element without the gallery feature.

Thanks,

Ben.
Administrator
Registered: Aug 2008
Posts: 3382
Put an id on the first link and start that.

<div id="detail" class='floatbox' data-fb-options="group:demo1">
<a id="a1" href="#d1"></a>
<a href="#d2"></a>
<a href="#d3"></a>
</div>


Now fb.start( 'a1' ) or fb.start( '#a1' ) will fire up from the link, including the options such as group assigned to that link.

When you fb.start a div reference, you are asking for the contents of that div. When you fb.start a link reference, it will be handled as if the link had the floatbox class on it and the user clicked it.

Page: 1