Git Product home page Git Product logo

englishextra / iframe-lightbox Goto Github PK

View Code? Open in Web Editor NEW
28.0 4.0 4.0 1.2 MB

Responsive no-jQuery pure JS/CSS Lightbox for iframes, no dependencies, customizable aspect ratio, 5kb unminified source code, with demo

Home Page: https://codepen.io/englishextra/pen/jmjayV

License: MIT License

HTML 29.52% JavaScript 53.24% CSS 9.47% Batchfile 0.06% SCSS 7.71%
lightbox vanilla-javascript vanilla-js css js html front-end frontend pwa webapp

iframe-lightbox's People

Contributors

codacy-badger avatar englishextra avatar gemmadlou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

iframe-lightbox's Issues

Allow scrolling

Add configuration (during initialization) allowing to scroll in iframed site.

How to add properties to generated html5 video, audio and img tags

Hi
First great work man. I love this plugin for its simplicity and small size.
I have a feature request.
Can you add support for adding properties to data-src like html5 video, audio, and even img tags?
For example, i use this to open an html5 video:

HTML5 Video

The video opens with iframe-lightbox in a video tag.
That's great but I wish we can set some properties on the video tag itself.
Instead of:

I wish to add some properties like

Can this be achieved? If not please kindly add this feature. Also, it should be applicable to audio, img tags as well.

thanks

Fails only when I add the preset class iframe-lightbox

You can ignore this, I was confused about which class to use in my HTML. I can't delete it

I was adding the class iframe-lightbox to my element - which was blowing up badly, because I now understand, this is the class that you've reserved to create within the js

allow use link in href atribute

Now, in href atribute is javascript:void(0);. Allow to use real link and initialize lightbox different way. Exchange it with data-src.

fix z-index

Set 'z-index' css property for .iframe-lightbox class to 999. 2 is not enough (bug can be see in latest WordPress theme).

PS: There is also z-index: 2; in .iframe-lightbox .content-holder I didn't investigate this.

Event handling

It would be awesome if there was a way of listening to events

  • when the iframe lightbox opens, when it closes
  • when the video starts playing etc

It may be overkill for what you originally intended as it's a great little plugin already. But if it's something you've considered, it'd be a great addition.

Increase iframe height on mobile screens

Hi,
more then issue, this is ask for an advice. On mobile device, proportions of iframe are kept. How may I increase height of iframe (on mobile)? See picture.

I have already fix width for mobiles:

@media (max-width: 767px) {
    .iframe-lightbox .content-holder {
        width: 95%;
    }
}

Thank you.

Feature request - pass iframe properties in

I was wanting to use this to embed some virtual tour / 3d model type things from various providers.

However, they all stack up tons of extra properties on the iframes that aren't part of the link.

Some examples:

    <iframe frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" 
            allow="autoplay; fullscreen; xr-spatial-tracking" 
            xr-spatial-tracking execution-while-out-of-viewport execution-while-not-rendered web-share 
            src="https://sketchfab.com/models/{{asset_id|raw}}/embed?autospin=1&autostart=1&ui_infos=0"> </iframe>
    <iframe src="{{asset_id|raw}}" width="100%" frameborder="0" style="border:0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
    <iframe width="100%" src="https://www.youtube-nocookie.com/embed/{{asset_id|raw}}?rel=0" title="YouTube video player" 
            frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
            allowfullscreen></iframe>

(The {{asset_id|raw}} tags are just how the Elementor Unlimited Elements widget passes properties through in my code)

I'm going to try embedding them using this anyway but I'm concerned that I cannot test all the features such as the xr-spatial-tracking, and I'm going to introduce hidden issues.

It would be nice to have some framework to pass this through, such as maybe any attributes on the link that start with data-frame-{anything} are added on as attributes to the iframe tag?

just branding suggestion: consider rename to 'IFLI'

Reconsider renaming to 'IFLI' IFrame LIghtbox. I personally like it more, but current name has god SEO (I googled it when I was looking for 'iframe lightbox').

In README.md you can add that the script is also:

  • request light - inlined svg right in css (only 2 additional request: 1. css + 1. js file)
  • retina (high DPI screens) ready - uses svg instead png

Close Link

Hi,

i want to creat a link with my own link and with a button to close the lightwindow.

There is any way to do it?

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.