开发者

Fancybox (ajax) width not showing correctly in IE(8,7)

I am using Fancybox for showing html files with ajax in [removed] and after struggling to make it work in IE now it is showing the wrong width.

$(document).ready(function() {
    $(".loginmodal").fancybox({
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic',
      开发者_Python百科  'width'         : 350
    });

    $(".agregardefmago").fancybox({
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic',
        'padding': 0,
        'margin':0,
        'autoScale':false,
        'width'         : 350,
        'type'          : 'ajax'
    });

});

This is the javascript in the header with:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="/static/fancybox/jquery.fancybox-1.3.4.css" media="screen" />

When clicking on <a href="/agregar-definicion.html" class="agregardefmago">Agregar Definicion</a> the fancybox appears with a correct automatically height but a wrong width.

I have tried removing the 'width' attribute, and many other combinations.

Thanks.


I believe the option you are looking for is autoDimensions.

$(".agregardefmago").fancybox({
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic',
        'padding': 0,
        'margin':0,
        'autoScale':false,
        **'autoDimensions':false,**
        'width'         : 350,
        'type'          : 'ajax'
    });

For more info: http://fancybox.net/api


Any specific reason why your using Fancybox?

I have also had some browser issues with it in the past (IE) so I switched to FaceBox seems to work a lot better in all browsers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜