Плагин jQuery SimpleModal - открыть на загрузке - PullRequest
1 голос
/ 20 декабря 2010

Я хочу использовать функцию подтверждения переопределения SimpleModal и изменить ее так, чтобы она активировалась на странице.

Может кто-нибудь помочь, пожалуйста?

Ссылка на страницу демонстрационной страницы SimpleModal.

Ответы [ 3 ]

3 голосов
/ 20 декабря 2010

Будет отображаться модальное диалоговое окно при загрузке страницы ...

$(document).ready(function() { 
    $('#basicModalContent').modal();
});
0 голосов
/ 05 декабря 2014

Откройте файл osx.js и удалите следующую строку (код начинается со строки 14)

        init: function () {
        ****$("input.osx, a.osx").click(function (e) { << delete this line
            e.preventDefault();**** << delete this line

            $("#osx-modal-content").modal({
                overlayId: 'osx-overlay',
                containerId: 'osx-container',
                closeHTML: null,
                minHeight: 80,
                opacity: 65, 
                position: ['0',],
                overlayClose: true,
                onOpen: OSX.open,
                onClose: OSX.close
            });
        }); <<< delete this line
    },

, чтобы стать

        init: function () {

            $("#osx-modal-content").modal({
                overlayId: 'osx-overlay',
                containerId: 'osx-container',
                closeHTML: null,
                minHeight: 80,
                opacity: 65, 
                position: ['0',],
                overlayClose: true,
                onOpen: OSX.open,
                onClose: OSX.close
            });

    },
0 голосов
/ 31 декабря 2010

Откройте файл verify.js и измените:

jQuery(function ($) {
    $('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
        e.preventDefault();

        // example of calling the confirm function
        // you must use a callback function to perform the "yes" action
        confirm("Continue to the SimpleModal Project page?", function () {
            window.location.href = 'http://www.ericmmartin.com/projects/simplemodal/';
        });
    });
});

Кому:

jQuery(function ($) {
    // example of calling the confirm function
    // you must use a callback function to perform the "yes" action
    confirm("Continue to the SimpleModal Project page?", function () {
        window.location.href = 'http://www.ericmmartin.com/projects/simplemodal/';
    });
});
...