Giter VIP home page Giter VIP logo

Comments (5)

vodkabears avatar vodkabears commented on July 4, 2024

You can also set options when you initialize it throw js, but you need to remove 'remodal' class:

<div class="modal" data-remodal-id="contact-modal-success">...</div>
<div class="modal" data-remodal-id="contact-modal-fail">...</div>
$('.modal').remodal({ hashTracking: false });

Class 'remodal' will be added dynamically.

from remodal.

siamkreative avatar siamkreative commented on July 4, 2024

Thanks, but unfortunately, removing the .remodal class causes the lookup to fail (Uncaught TypeError: Cannot read property 'open' of undefined).

Full code:

if ($.remodal) {
    var modalFail = $.remodal.lookup[$('[data-remodal-id=contact-modal-fail]').data('remodal')];
    modalFail.open();
}

from remodal.

vodkabears avatar vodkabears commented on July 4, 2024

@siamkreative you do something wrong. Look:

So it is your modals:

<div class="modal" data-remodal-id="contact-modal-success">...</div>
<div class="modal" data-remodal-id="contact-modal-fail">...</div>

Put the js code to the end:

// It is inizializtion of the modals.
// If you don't write .remodal class in your HTML, they don't initialize automatically.
$('.modal').remodal({ hashTracking: false });

// Only after that, you can get the instance:
var modalFail = $.remodal.lookup[$('[data-remodal-id=contact-modal-fail]').data('remodal')];
modalFail.open();

from remodal.

vodkabears avatar vodkabears commented on July 4, 2024

@siamkreative or maybe you use the old version)

from remodal.

siamkreative avatar siamkreative commented on July 4, 2024

Works perfectly indeed: http://jsfiddle.net/pxEA5/

Thanks!

from remodal.

Related Issues (20)

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.