Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/459.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何为qtip 2警报提供默认警报功能行为_Javascript_Qtip_Qtip2 - Fatal编程技术网

Javascript 如何为qtip 2警报提供默认警报功能行为

Javascript 如何为qtip 2警报提供默认警报功能行为,javascript,qtip,qtip2,Javascript,Qtip,Qtip2,我正在使用qtip2显示web应用程序的警报消息(如所示) 我的代码是 1) 对话 function dialogue(content, title) { /* * Since the dialogue isn't really a tooltip as such, we'll use a dummy * out-of-DOM element as our target instead of an actual element like document.body

我正在使用qtip2显示web应用程序的警报消息(如所示)

我的代码是

1) 对话

function dialogue(content, title) {
    /* 
    * Since the dialogue isn't really a tooltip as such, we'll use a dummy
    * out-of-DOM element as our target instead of an actual element like document.body
    */
    $('<div />').qtip(
                {
                    content: {
                        text: content
                       , title: {
                           text: 'PMGSY ',
                           button: 'Close'
                       }
                    },
                    position: {
                        my: 'center', at: 'center', // Center it...
                        target: $(window) // ... in the window
                    },
                    show: {
                        ready: true, // Show it straight away
                        modal: {
                            on: true, // Make it modal (darken the rest of the page)...
                            blur: false, // ... but don't close the tooltip when clicked
                            escape: false
                        }
                    },
                    hide: false, // We'll hide it maunally so disable hide events

                    style: {
                        classes: 'qtip-shadow qtip-rounded qtip-dialogue', // Optional shadow...
                        widget: true //themeroller
                    },

                    events: {
                        // Hide the tooltip when any buttons in the dialogue are clicked
                        render: function (event, api) {
                            $('button', api.elements.content).click(api.hide);
                        },
                        // Destroy the tooltip once it's hidden as we no longer need it!
                        hide: function (event, api) { api.destroy(); }
                    }
                });
}
如何使我的自定义警报模拟默认警报功能? 请帮助更换

ok = $('<button />', { text: 'Ok', 'class': 'full' });
ok=$('',{text:'ok','class':'full'});

ok=$(“”,{text:'ok','class':'full'})。单击(函数(){
窗口。位置。替换(“/Home/startPage”);
});
Alert("Customised alerts"); //this doesent show      
window.location.replace("/Home/startPage");
ok = $('<button />', { text: 'Ok', 'class': 'full' });
ok = $('<button />', { text: 'Ok', 'class': 'full' }).click(function(){
    window.location.replace("/Home/startPage");
});