![]()
这个插件能够在你你行动时给出确认信息。
原文:http://nadiaspot.com/jquery/confirm/
本文版权属于原作者。
未经本站允许不得转载!
文档:
(element).confirm(options)
| options | ||||
|---|---|---|---|---|
| Name | Type | Optional | Description | Default Value |
| msg | String | Optional | Confirmation message | 'Are you sure?' |
| stopAfter | string | Optional | Determines when the confirmation dialog will stop being promoted. Possible values ('never', 'ok', 'cancel', 'once') | 'never' |
| wrapper | String | Optional | Dialog wrapper | '<span></span>' |
| eventType | String | Optional | The event that triggers the confirmation | 'click' |
| dialogShow | String | Optional | Dialog displaying effect | 'show' |
| dialogSpeed | String | Optional | Dialog displaying speed | 'fast' |
| timeout | Integer | Optional | Time in milliseconds to hide the confirmation dialog | 0 |
| options.buttons | ||||
| ok | String | Optional | Ok caption | 'Yes' |
| cancel | String | Optional | Cancel caption | 'No' |
| wrapper | String | Optional | Button wrapper | '<a href="#"></a>' |
| separator | String | Optional | Separator between buttons | '/' |
| cls | String | Optional | Button class | undefined |
例1:
// The action.
$('a').click(function() {
alert('click');
return false;
})// The most simple use.
$('a').confirm();
预览1:
DEMO1
例2:
// The action.
$('input[type=button]').click(function() {
$(this).remove();
});$('input[type=button]').confirm({
msg:'Do you really want to delete this button?',
timeout:3000
});
预览2:
DEMO2例3:
// The action.
$('span').mouseover(function() {
$(this).html('Here is the offer');
});$('span').confirm({
msg:'See my interesting offer?',
stopAfter:'ok',
eventType:'mouseover',
timeout:3000,
buttons: {
ok:'Sure',
cancel:'No thanks',
separator:' '
}
});
预览3:
DEMO3例4:
$('a').confirm({
timeout:3000,
dialogShow:'fadeIn',
dialogSpeed:'slow',
buttons: {
wrapper:'<button></button>',
separator:' '
}
});
预览4:
DEMO4源文件下载:http://www.hotajax.org/download/jquery/jQuery Confirm Plugin.zip

| < Prev | Next > |
|---|
- 05/12/2007 19:43 - Animated InnerFade with JQuery
- 30/11/2007 20:39 - jRails - jQuery on Rails
- 28/11/2007 22:59 - jQuery Multimedia Portfolio
- 10/11/2007 22:11 - jquery biggerlink
- 07/11/2007 03:30 - Semitransparent rollovers made easy with JQuery
- 03/11/2007 07:25 - jQuery lightbox plugin
- 24/10/2007 03:35 - 链接检查器(jquery)
- 09/10/2007 22:39 - magicpuff(jquery plugin)
- 21/09/2007 09:53 - 图片加载延迟(jquery应用)
- 21/09/2007 08:32 - 数字拼图游戏(jquery应用)







