Fancybox passing variable to append
I have fancybox. Now i need pass some variable in here.
append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"><div style="padding-left:5px;">NEED PASS VARIABLE HERE</div></div><div cl开发者_C百科ass="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
How can I do? Or if I can split from title into "NEED PASS VARIABLE HERE"? Idea is but comment box bottom opened picture and comment box need picture ID. Maybe there is more simple way if yes then I am happy if somebody share with me?
Best Regards, R
You can always capture the click with jquery or javascript, when opening and on that click capture the ID you have it in the class or another place you want to and afterwards you can print it where you want it.
HTML
<a class="someclass id" href="">open</a>
JS
var params = $(this).attr('class').split(' ');
var id = params[1];
if you give more info, you get a better answer :-)
精彩评论