jQuery   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了基于jquery ui的alert,confirm方案(支持换肤)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

实现功能

1.修改标题样式。把jquery ui的标题样式放上去。支持换肤。

2.修改按钮样式,换成jqueryui的button按钮样式。

3.将模式化窗口的背景换成了jqueryui的模式化背景。

代码


 
 
  
  
  
  

(function($) {

$.alerts = {

// these properties can be read/written by accessing $.alerts.propertyName from your scripts at any time

verticalOffset: -75,// vertical offset of the dialog from center screen,in pixels
horizontalOffset: 0,// horizontal offset of the dialog from center screen,in pixels/
repositionOnResize: true,// re-centers the dialog on window resize
overlayOpacity: .01,// transparency level of overlay
overlayColor: '#FFF',// base color of overlay
draggable: true,// make the dialogs draggable (requires UI Draggables plugin)
okButton: '确认',// text for the OK button
cancelButton: '取消',// text for the Cancel button
dialogClass: null,// if specified,this class will be applied to all dialogs

// Public methods

alert: function(message,title,callBACk) {
if( title == null ) title = 'Alert';
$.alerts._show(title,message,null,'alert',function(result) {
if( callBACk ) callBACk(result);
});
},confirm: function(message,callBACk) {
if( title == null ) title = 'Confirm';
$.alerts._show(title,'confirm',prompt: function(message,value,callBACk) {
if( title == null ) title = 'Prompt';
$.alerts._show(title,'prompt',// Private methods

_show: function(title,msg,type,callBACk) {

$.alerts._hide();
$.alerts._overlay('show');

$("BODY").append(
'<div id="popup_container" style="width:300px;height:150px;">' +
'<h2 id="popup_title" style="margin:0;padding:0;" class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-Helper-clearfix">' +
'<div id="popup_content">' +
'<div id="popup_message">

大佬总结

以上是大佬教程为你收集整理的基于jquery ui的alert,confirm方案(支持换肤)全部内容,希望文章能够帮你解决基于jquery ui的alert,confirm方案(支持换肤)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。