modal.leanModal({dismissible:false}) does not work: tested
issue #1239 is valid.
tested and demonstrated here: http://codepen.io/anon/pen/oXBKeg using example copied from: http://materializecss.com/modals.html
OSX Yosemite / Chrome Version 43.0.2357.81 (64-bit)
OSX Yosemite / Firefox Version 38.0.1
the open function allows you to pass in different options. The leanModal call is for setting up a trigger and is not meant to be called on the modal itself. http://codepen.io/Dogfalo/pen/qdrBev
Please update the documentation to reflect this.
Ran into this too, please update documentation.
It's very unintuitive, I'd even call for a design change, such that calling openModal without any arguments would default to the arguments it's been initialized with.
Is it possible to set "ready" and "complete" callback functions of the modal, without opening the modal ?
its added to documenttaion.
The problem is with including jquery. if you have 2 jquery included while setting no conflict to $ use jQuery 2.1X.x and it will work for you !
include in following order
src="https://code.jquery.com/jquery-2.1.4.min.js"> rel="stylesheet" href="./css/materialize.min.css" media="screen,projection"/> src="./js/velocity.min.js"> src="js/materialize.min.js">
Hope this will help you
Thanks @erBhushanPawar! My mistake is including materializecss.js before jquery and I have a lot of problems - not working modals, toasts etc... You save my day!
hey guys. I've got a serious problem with modals. it doesnt' respond. I've initialised and done the coding - a copy and paste from the website- but it still doesnt work. Please could some one just post the code to include in my js file. i think that is where my prob is.
$('#modalConfirmOrder').openModal({ dismissible: false, // Modal can't be dismissed by clicking outside of the modal opacity: .5, // Opacity of modal background in_duration: 300, // Transition in duration out_duration: 200, // Transition out duration ready: function() { }, // Callback for Modal open complete: function() { /*alert('Closed');*/ } // Callback for Modal close });
also make sure that you have addressed previous solution too
thanks a lot @erBhushanPawar. But just one more question. i"ld like to call this function onclick(an image for example). this code runs from when my tab loads.
Oh. I got it!!!. Thanks again.
@Dogfalo Could you please add it back to the documentation? Why was it taken out again? It's important to know that openModal() can take options.
There is no more openModal(). It's been changed to .modal('open').
Does anyone knows how to open modal and add a callback now?
Also does anyone else has problems with opening modals programatically using the .modal('open')? It seems it doesn't work for me.
@dbr0 Dude, I think they have adapted bootstrap method this time. I hope this document will help you http://www.w3schools.com/bootstrap/bootstrap_ref_js_modal.asp
@erBhushanPawar Using .modal('show')' from link you have given gives Error: Method show does not exist on jQuery.modal`.
Not working on clicking on browser back button.
Still the modal '.modal-overlay' exist on DOM.