Answer the question
In order to leave comments, you need to log in
How to make a script with jquery work?
There is a Script tympanus.net/Development/DialogEffects
The script worked for ok, but after installing it on modx evo and connecting the yams module, it stopped working correctly.
It certainly works and fulfills, but when pressed, a window appears and disappears.
How can I make the script process without refreshing the page?
Poke here: Ooos.ru (Login for clients/CMS-Site Management)
Answer the question
In order to leave comments, you need to log in
Why do you need a link?
If you want to leave it, then somewhere in the script it is required
$(document).on('click', '[data-dialog]', function (e) {
e.preventDefault();
});
$(function () {
var trigger = $('[data-dialog]'),
type = trigger.data('dialog'),
dialog = new DialogFx(type);
trigger.on('click', function (e) {
e.preventDefault();
dialog.toggle.bind(dialog);
});
})();
If I understand correctly, then this function calls the dialog for you
(function() {
var dlgtrigger = document.querySelector( '[data-dialog]' ),
somedialog = document.getElementById( dlgtrigger.getAttribute( 'data-dialog' ) ),
dlg = new DialogFx( somedialog );
dlgtrigger.addEventListener( 'click', dlg.toggle.bind(dlg) );
return false;
})();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question