(vedere modifica sotto per una migliore risposta)
Per i contenuti iframe, il tuo html dovrebbe apparire come
<a class="fancyboxhd fancybox.iframe" href="hdfile.html">hd</a>
<a class="fancyboxsd fancybox.iframe" href="sdfile.html">sd</a>
quindi aggiungere queste due opzioni per i vostri script
fitToView : false,
autoSize : false
così i vostri script dovrebbe essere simile
$(document).ready(function(){
$('.fancyboxhd').fancybox({
width : 1287,
height : 720,
fitToView : false,
autoSize : false
});
$('.fancyboxsd').fancybox({
width: 640,
height: 360,
fitToView : false,
autoSize : false
});
});
### EDIT ###: (5 set 2013)
Il codice può essere migliorato e semplificato utilizzando gli attributi (HTML5) data-*
negli ancoraggi e lo stesso class
per entrambe le opzioni come:
HTML
<a class="fancybox fancybox.iframe" data-width="1287" data-height="720" href="hdfile.html">HD</a>
<a class="fancybox fancybox.iframe" data-width="640" data-height="360" href="sdfile.html">SD</a>
JS
$('.fancybox').fancybox({
fitToView: false,
autoSize: false,
afterLoad: function() {
this.width = $(this.element).data("width");
this.height = $(this.element).data("height");
}
});
Vedere JSFIDDLE
NOTA: Al momento di questa modifica, demo utilizzato fancybox v2.1.5.
Grazie. Lavorato. : D – dpDesignz
ha funzionato. Grazie mille. – amilaishere
ha lavorato anche qui: D grazie – rafuru