javascript - Pass a class name to fancybox on js call -
so have fancybox i'm opening this:
$('.btn-test').on("click",function(){ $.fancybox.open({ 'content': $('.modal_size-chart'), 'minwidth': 380, 'minheight': 550, 'width': 380, 'height': 550, 'maxwidth': 380, 'maxheight': 550, 'autoscale': false, 'autodimensions': false, 'fittoview': false, }); }); my problem this, if alter box via css, change propagate other fancyboxes might open , .modal_size-chart needs specific styling rest of boxes don't.
so there way pass desired class name fancybox on call ?
it turns out needed add tpl attribute ( explained in documentation site : object containing various templates.. jezz...) , wrap attribute inside tpl.
so ended being this:
$('.btn-test').on("click",function(){ $.fancybox.open({ 'content': $('.modal_size-chart'), 'minwidth': 380, 'minheight': 550, 'width': 380, 'height': 550, 'maxwidth': 380, 'maxheight': 550, 'autoscale': false, 'autodimensions': false, 'fittoview': false, 'tpl': { wrap:'<div class="fancybox-wrap class want add here" tabindex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>' } }); });
Comments
Post a Comment