Code Monkey home page Code Monkey logo

fb.modal's Introduction

fb-modal

plugin para implememtar modales con video en falabella.com.co

Modo de uso

paso 1

En el html se crean los elementos que serviran para lanzar el modal:

<body>
    <p class="modal1">youtube video</p>   
    <p class="modal2">source video</p>
<body>

paso 2

Incluir el script en la página:

<body>
    <p class="modal1">youtube video</p>   
    <p class="modal2">source video</p>
    <script src="../fb-modal.min.js"></script>
<body>

paso 3

Despues de cargar la librería se instancia la clase y se inicia el complemento, se envian las opciones para crear el modal:

video YouTube:

    <script type="text/javascript">
        const modalVideo1 = new Modal({
            domElement: 'modal1',
            elementType:'youtube',
            source: 'https://www.youtube.com/embed/tgbNymZ7vqY?autoplay=1',
            background: '#aad500',
            opacity: .95,
            width: 600,
            height: 300
        })
    </script>

Fuente de video:

    <script type="text/javascript">
        const modalVideo2 = new Modal({
            domElement: 'modal2',
            elementType: 'video',
            source: 'https://www.w3schools.com/html/mov_bbb.mp4',
            background: '#e4022d',
            opacity: .70
        })
    </script>

paso 4

Despues de instanciar la clase y definir las opciones se inicializa cada instancia:

    <script type="text/javascript">
        modalVideo1.init()
        modalVideo2.init()
    </script>

fb.modal's People

Stargazers

David Frank avatar

Watchers

David Frank avatar

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.