网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

iframe自适应高度的插件

项目地址:https://github.com/house9/jquery-iframe-auto-height

成都创新互联公司专注于雨山网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供雨山营销型网站建设,雨山网站制作、雨山网页设计、雨山网站官网定制、小程序开发服务,打造雨山网络公司原创品牌,更为您提供雨山网站排名全网营销落地服务。

跨域无效!

用法:

jQuery('iframe').iframeAutoHeight(); 设置所有的iframe

$('iframe.photo').iframeAutoHeight();指定的iframe

选项:

  • callback: function

    • Default empty function

    • Optionally define a callback function (in this case inline) that will do something with the callbackObject.newFrameHeight value. This can for instance be used with easyXDM to alert another domain that the frame has changed height.

    • Example:$('iframe').iframeAutoHeight({callback: function(callbackObject) { alert(callbackObject.newFrameHeight);} });

    • you can also access the current iframe jquery wrapper object use the this keyword

    • for example:callback: function(callbackObject) { alert(callbackObject.newFrameHeight + " and the iframe href is:" + $(this).attr('src')); }

  • debug: boolean

    • Default is false

    • Will log some internal information to the console, if available

    • Example: $('iframe').iframeAutoHeight({debug: true})

  • heightOffset: integer

    • Default is 0

    • Unit is pixels

    • Optionally add some buffer to the bottom

    • Example: $('iframe').iframeAutoHeight({heightOffset: 20});

  • minHeight: integer

    • Default is 0

    • Unit is pixels

    • Sets the iframe height to this value if the calculated value is less

    • Example: $('iframe').iframeAutoHeight({minHeight: 200});

  • animate: boolean

    • Default is false

    • Uses jquery animate with duration of 500 when resizing the iframe

    • Example: $('iframe').iframeAutoHeight({animate: true});

  • resetToMinHeight: boolean

    • Default is false

    • hard set the iframe height to the minHeight before re-sizing

  • triggerFunctions: Array of functions

    • Default is an empty array

    • Optionally define 1 or more functions that will have access to the resize method

    • can be used to resize the iframe from external events such as click or window resize - see examples below

  • heightCalculationOverrides: Array of 2 element arrays

    • Default is an empty array

    • Optionally re-define the height calculation method(s)

    • override the default implementation or just override specific browsers

    • Example:$('iframe').iframeAutoHeight({strategyOverrides: [{ browser: 'mozilla', calculation: function () { return 2000; }}]);

    • The browser key should be one of 'webkit', 'mozilla', 'msie', 'opera' or 'default', seehttp://api.jquery.com/jQuery.browser/

    • The calculation key should be a function, usually with the signature(iframe, $iframeBody, options, browser)

    • see more examples below

上传了压缩包

附件:http://down.51cto.com/data/2363378

本文名称:iframe自适应高度的插件
文章转载:http://bjjierui.cn/article/gpjohi.html

其他资讯