Guru Guru - 14 days ago 5
jQuery Question

jQuery fancybox issue - want to show 1 section

I want to create dialog using fancybox but failed.

For instance

<a class='btn'>Btn1</a>
<a class='btn'>Btn2</a>
<div class='fancycontent'> Fancy Content</div>


If you click btn1 or btn2 'fancycontent' should appear as popup.

How can I implement this without duplicating div tag into every a tag?.

Answer

you could assign same class to Btn1 and Btn2.

And you could use fancybox with that class.