Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WenLiangTseng/6050945 to your computer and use it in GitHub Desktop.
Save WenLiangTseng/6050945 to your computer and use it in GitHub Desktop.
FancyBox 設定 iframe 的寬度和高度
/*FancyBox-設定 iframe 的 寬度和高度
FancyBox很漂亮的陰影效果,
還可以放圖片、內連、ajax和 iframe內容
檔案不大,使用也很簡單。
英文官網:http://fancybox.net/
中文說明:http://www.icyfire.me/2009/07/jqueryfancybox/
但有個bug,就是內容為 iframe 的時候,
寬度和高度的設定沒作用
後來找到這裡:
http://www.arzion.com/internet-business/posts/Popups-with-FancyBox
這位老兄是用 id 去設定參數
*/
javascript:
$("#popup").fancybox({
'frameWidth': 300,
'frameHeight': 82,
'hideOnContentClick': false,
'overlayOpacity': 0.85
});
HTML:
class="iframe" href="popup.html" name="popup" id="popup">Open popup
/*
和官網的範例是用 class 設定的方式不一樣。
但就是這樣,參數就可以設定進去了。
果然是: 不是做不到,一時沒想到。
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment