Skip to content

Keep same and cross domain iFrames sized to their content with support for window/content resizing, in page links, nesting and multiple iFrames

Notifications You must be signed in to change notification settings

swdreams/iframe-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iframe widget

NPM version NPM Downloads

version: 1.1.7

This project was bootstrapped with iframe-resizer.

Available Scripts

In the project directory, you can run:

`npm run build`

Include library.

// client page
<script src="https://cdn.jsdelivr.net/npm/ds-iframe-widget/dist/ds-iframe-widget.js"></script>

// host page that is served in iframe
<script src="https://cdn.jsdelivr.net/npm/ds-iframe-widget/dist/ds-iframe-widget-content.js"></script>

Example 1 embedded page.

<script src="https://cdn.jsdelivr.net/npm/ds-iframe-widget/dist/ds-iframe-widget.js"></script>
<script>
  DsIframeWidget.init('#myIframe', {
      baseUrl: "https://bing.com/",      
  });
</script>

<iframe id="myIframe" title="Iframe Widget"
    frameborder="no" allowtransparency="true" allowfullscreen=""
    style="display: block; width: 1px; min-width: 100%;"
    scrolling="no"
>
</iframe>

Example 2 modal popup.

<script src="https://cdn.jsdelivr.net/npm/ds-iframe-widget/dist/ds-iframe-widget.js"></script>
<script>
    DsIframeWidget.init('#myButton', {
        widgetMode: 'modal', 
        baseUrl: "https://bing.com/",
    });
</script>        

<button id="myButton">Mint on dropspace</button>

Authors

Liki Crus

About

Keep same and cross domain iFrames sized to their content with support for window/content resizing, in page links, nesting and multiple iFrames

Topics

Resources

Stars

Watchers

Forks

Packages