#inline multiple times

47 views
Skip to first unread message

eas...@cstonecanada.com

unread,
Apr 27, 2012, 10:46:33 AM4/27/12
to fancybox
Hi everyone,

I would like to use the code below multiple times on my webpage, as I
have several links (privacy policy, refund, terms and conditions).
However, I cannot as they use IDs, instead of classes. I tried using
the group_elements, but couldn't figure it out.

Can someone please explain how I can change the code below so I can
use it multiple times on my page?


<a id="inline" href="#data">This shows content of element who has
id="data"</a>

<div style="display:none"><div id="data">Lorem ipsum dolor sit amet,
consectetur adipiscing elit.</div></div>

Thank you!

JFK

unread,
Apr 27, 2012, 10:02:19 PM4/27/12
to fancybox
you can actually have both IDs and classes so try

<a id="myID01" class="fancybox" href="#data">This shows content of
element who has id="data"</a>
<a id="myID02" class="fancybox" href="#data2">This shows content of
element who has id="data2"</a>
<a id="myID03" class="fancybox" href="#data3">This shows content of
element who has id="data3"</a>
etc

then use the class for fancybox
$(".fancybox").fancybox({
// options here
});

On Apr 27, 7:46 am, "east...@cstonecanada.com"
Reply all
Reply to author
Forward
0 new messages