开发者

fancybox: change height and width property after

开发者 https://www.devze.com 2023-02-03 17:40 出处:网络
Yes i have a simple fancybox with specified height and width. When you click a link inside this fancybox it runs a ajax request. On this request´s success, i wish the fancybox to change height an开发

Yes i have a simple fancybox with specified height and width.

When you click a link inside this fancybox it runs a ajax request. On this request´s success, i wish the fancybox to change height an开发者_如何学Pythond width.


Create a div for your ajax, and another to contain it. Have the containing div be fixed height and overflow: hidden. When the ajax loads run .height() with jQuery on the inner div, then assign a variable and have the container .animate() to fit.


A little late but still valid:

$.fancybox.update()

// Auto-sizes fancyBox height to match height of content

or

$.fancybox.toggle()

// If content is resized to fit inside viewport than it will be expanded to full size (and vice verse)
0

精彩评论

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