javascript - How can I stop fancybox from resizing? -
i beginner, have limited knowledge on coding. trying create website uses fancybox2 image galleries. added facebook button , facebook comment box each photo. here's code:
$(".fancybox").fancybox({ beforeshow: function () { if (this.title) { currenthref = this.href; this.title += '<br /> <br/>'; // line break after title this.title += '<div class="fb-like" style="margin:0; padding:0" data-href="' + currenthref + '" data-width="400" data-layout="standard" data-action="like" data-show-faces="false" data-share="false"></div>'; this.title += '<br />'; // line break after title this.title += '<div class="fb-comments" data-href="http://mundonimona.com/' + currenthref + '" data-num-posts="2" data-width="400"></div>'; } }, aftershow: function () { fb.xfbml.parse(); }, helpers: { title: { type: 'inside' } }
});
http://jsfiddle.net/brewhildah/999ly4vm/9/
the facebook , comment box worked in website. problem photos getting resized after facebook plugins loaded. become smaller. how can ensure the slides not resize after facebook things have loaded (so viewing photos , moving 1 slide go smoothly).
thank help!
you combine fittoview
, maxwidth
api options achieve :
$(".fancybox").fancybox({ fittoview: false, maxwidth: "85%", // other api options });
see forked jsfiddle
Comments
Post a Comment