开发者

jquery fancybox width issue

The jquery fancybox width is abnormal. means it is equal to the width of the page. If i change the class name to 'iframe' width works fine else width is miss behaving.

$(".iframe_reg2").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut开发者_StackOverflow社区' :   'elastic',
        'speedIn'       :   600,
        'speedOut'      :   200,
        'overlayShow'   :   false,
            'width'         :       400
    });

And my Html is

 <a class="iframe_reg2" href="http://google.com">Google</a>


U need to set autoDimensions to false if you're specifying the width yourself. So ideally , the call should be

$(".iframe_reg2").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600,
        'speedOut'      :   200,
        'overlayShow'   :   false,
        'autoDimensions':   false,
        'width'         :   400
    });

I think this should work :)


Your anchor tag does not have an href value, which is a key attribute to making the plugin work. (edit: I see now what the "iframe" class is for, but I like using the query string instead). It's a bit difficult to tell what you mean to do with your sample, but my guess is that you're attempting to grab Google and put it into the fancybox (as a test).

You should also remove the comma from your last attribute, as it will trip up some browsers.

I can't see why this wouldn't work:

$(".pageViewer").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600,
        'speedOut'      :   200,
        'overlayShow'   :   false
    });

with HTML

<a class="pageViewer" href="http://google.com?iframe">Google</a>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜