導航:首頁 > 編程語言 > jsconfirm插件

jsconfirm插件

發布時間:2023-04-01 03:43:01

js中用confirm("str")彈出的消息框怎麼設置按鈕的文本

沒辦法設置,那個文本是系統設定的,你用不同的操作系統可能會有所差別。
你要設置,你就用彈出層的方法。模擬出那樣的一個效果。

❷ js confirm怎麼實現自定義標題

這是瀏覽器自帶的,無法修改,可以用插件實現自定義提示,如art.dialog

❸ vue.js中confirm怎樣實現

<template>
<divclass="confirm">
<divclass="shade"></div>
<divclass="content">
<divclass="top">提示</div>
<divclass="center">{{title}}</div>
<divclass="bottom">
<buttonv-on:click="clickBtn(true)">確定</button>
<buttonv-on:click="clickBtn(false)">取消</button>
</div>
</div>
</div>
</template>
<script>
//importVuefrom'vue'
exportdefault{
name:'confirmCmp',
props:['title'],
data(){return{
}},
methods:{
clickBtn(b){
this.close();
//監聽result變化,並發出通知(在angularjs中叫做廣播,angularjs提供了emit,broadcast和$on服務用於向子父中傳遞消息)
this.$emit('result',b);
},
open(){
document.querySelector('.confirm').style.display='block'
},
close(){
document.querySelector('.confirm').style.display='none'
}

},
mounted(){
//垂直居中
varwindowHeight=window.innerHeight;
vardomObj=document.querySelector('.content');
vardomObjHeight=domObj.offsetHeight;
//console.log(domObjHeight)不知道為啥獲取不到高
vartop=windowHeight/2-77;
domObj.style.top=top+'px';
},
install(Vue){//核心部分,在我們使用Vue.use()時,自動調用的是install,而install導出的必須是的組件
//console.log('confirmCmpInstall');
Vue.component('confirmCmp',this);
}
}
</script>
<style>
.confirm{display:none;
position:fixed;z-index:1;width:100%;
height:100%;
}

.shade{
position:fixed;
z-index:2;
background-color:rgb(0,0,0);
opacity:0.3;
width:100%;
height:100%;
}
.content{
background-color:white;
z-index:3;
width:260px;
margin:auto;
position:relative;
left:0;right:0;
}

.top{
padding-left:20px;
background:#f6f6f6;
/*color:#212a31;*/
font-size:16px;
font-weight:700;
height:46px;
line-height:46px;
border-bottom:1pxsolid#D5D5D5;
}
.center{
padding:20px;
line-height:20px;
font-size:14px;
}
.bottom{
border-top:1pxsolid#D5D5D5;
text-align:center;
height:46px;
line-height:46px;
background:#f6f6f6;}
.bottombutton{width:60px;border:none;height:30px;display:inline-block;}
.bottombutton:first-child{background-color:#1E9FFF;color:white;margin-right:3px}
.bottombutton:last-child{margin-left:3px}

</style>

<!--插件開發教程-->
<!--https://cn.vuejs.org/v2/guide/plugins.html-->

<!--此辦法行不通
http://www.cnblogs.com/yufann/p/Vue-Node8.html-->

❹ 瀏覽器JS環境中,如何非同步使用原生confirm

1、讓視頻在困敗confirm前最小化。youku就是這么做的吧,反正老是提示登陸的時候彈出來。
2、用其他語言實現汪早顫confirm,而不是javascript。試試flash,silverlight之類的能不能搞定。不行自己搞個瀏覽器插件睜野彈confirm。

❺ 我 怎麼使用jquery.plugins.js插件

jQuery插件 要使用它的話 通常插件中都有demo或者api可以查閱
通常jQuery插件為了減小體積 會發布兩個版本 XXX.js和XXX.min.js

如果你要修改插件需要使用XXX.js文件

首先 你要知道它怎麼用,先有一個可用的demo(沒有demo就自己寫一個),然後用webkit內核或firefox進行斷點查看,這主要是為了找插件入口點,當然 你也可以直接查看js代碼 這需要一定的底子
最後 就是慢慢查看他的代碼的實現功能了,先得看懂他是怎麼實現的,然後你才會知道怎麼改.

jQuery插件我也寫的不少 像 模擬alert/confirm/prompt 錯誤信息提示框 模擬彈出窗體 無縫marquee滾動 分頁控制項 拖拽控制項等等

jQuery插件的框架寫法通常是

(function($){
$.fn.extend({
fnKey:function(){}
})
//或者
$.fn.fnKey=function(){}
})(jQuery)

上面的兩種寫法的調用 方式 是

$("XXX").fnKey()進行調用的

還有一種寫法:
var fnClass = function(){
this.fnKey=function(){
}
this.props="";
}

這種寫法是的調用 方式是
fnClass obj = new fnClass();
obj.fnKey();

第二種寫法是js的面向對象編程 得自己慢慢的理解哈

❻ vue提示彈窗插件(alert、confirm、msg)

-moles:放置禪殲模茄襲頃塊的文件夾,裡面有一個 alert 文件夾,用於存放 alert 插件 ;
-Alert.vue:就是我們要在多處用到提示彈窗組件;
-index.js:對於該自顫陸定義插件的一些配置;

1.alert

2.confirm

原文 https://blog.csdn.net/sinat_40697723/article/details/106036056

❼ js 中confirm的用法

confirm() 方法用於顯示一個帶有指定消息和OK 及取消按鈕的對話框。

如果用戶點擊確定按鈕,則confirm() 返回true。如果點擊取消按鈕,則confirm() 返回false。

在用戶點擊確定按鈕或取消按鈕把對話框關閉之前,它將阻止用戶對瀏覽器的所有輸入。在調用confirm() 時,將暫停對JavaScript 代碼的執行,在用戶作出響應之前,不會執行下一條語句。

下面我們通過這兩個小例子,來了解一下它的使用方法吧:

<html>
<head>
<title>confrim的使用方法</title>
<scripttype="text/javascript">
functionclear1()
{
if(confirm("確定要清空數據嗎?"))
{
document.main.text1.value="";
}
}
</script>
</head>
<boty>
<formname="main">
<inputtype="text"name="text1"/>
<inputtype="button"name="submit"value="數據清空"onclick="returnclear1()"/>
</form>
</body>
</html>

❽ jquery 模擬 confirm 要求使用方法和 window.confirm 一樣

$.confirm = function(msg,func1,func2,w,h) ;

function Confirm(msg,func1,func2,w,h){
var opts = };
//這里還可以判斷msg的長度進行排版,並調整彈出框的大小
install(window.top, opts);
$.DialogData.dialogDiv.find("div[id^='_DialogButtons_']").css('text-align','center')

var win = topWin.$.DialogData.iframeObj.attr('contentWindow');
var doc = win.document;
doc.open();
doc.write("<body></body>") ;
var arr = [];
arr.push("<div><table height='100%' border='0' align='center' cellpadding='10' cellspacing='0'>");
arr.push("<tr><td align='center'><img id='Icon' src='../images/icon_query.gif' width='34' height='34' align='absmiddle'></td>");
arr.push("<td align='left' id='Message' style='font-size:9pt'>"+msg+"</td></tr></table></div>");
var div = $(arr.join(''),doc.body);
$(doc.body).append(div);
doc.close();

//設置響應函數
//如果傳遞響應函數則執行,否則僅關閉窗口
$.DialogData.dialogDiv.find("input[id^='_ButtonOK_']").bind("click", function() {
$.unfunkyUI();
if(func1){
func1();
}
})
$.DialogData.dialogDiv.find("input[id^='_ButtonCancel_']").bind("click", function() {
if(func2){
func2();
}
}) ;
}

})(jQuery);

❾ js confirm 怎麼修改它的按鈕

這個是修改不到的!
那個按鈕是瀏覽器本身的運行機制決定的!
如果你覺得針對js confirm本身的按鈕可以進行修改的話,那你只能修改瀏覽器程序
當然,你覺得那按鈕難看的話,你可以使用別的js插件

❿ javascript confirm用法

用法一:主要用於刪除單條信息確認。

<SCRIPT LANGUAGE=javascript>

function del() {

var msg = "您真的確定要刪除嗎? 請確認!";

if (confirm(msg)==true){

return true;

}else{

return false;

}

}

</SCRIPT>

調用方法:

<a href="del.php?id=123" onclick="javascript:return del()">刪 除</a>

用法二:原理跟用法一的一樣。JavaScript刪除確認框 。

<a href="javascript:if(confirm('確實要刪除嗎?'))location='jb51.php?id='">刪除</a>

用法三:主要用於批量刪除的確認提示 。

<input name="Submit" type="submit" class="inputedit" value="刪除"

onclick="{if(confirm('確定紀錄嗎?')){

this.document.formname.submit();

return true;}return false;

}">

<input name="按鈕" type="button" ID="ok" onclick="{if(confirm('確定刪除嗎?')){

window.location='Action.asp?Action=Del&

TableName=Item&

ID=<%=ID%>';

return true;

}return false;}"

value="刪除欄目" />

(10)jsconfirm插件擴展閱讀:

confirm參數message:

1、confirm()函數中的參數是確認框的提示語。

2、此函數返回值是布爾型的,點擊確定,返回值為true,點擊取消返回值為false。

3、confirm快速調用:

<a<a target

="_blank" href

="/item/href/7779531" data-lemmaid

="7779531">href</a>

="#"onclick

="returnconfirm('是否打開鏈接');"><inputtype

="button"value

="鏈接"/></a>

註:點擊鏈接後,在彈出對話方塊中,如果點擊「確定」那麼就進入超鏈接所連接的地址;如果點擊「取消」不執行鏈接。

閱讀全文

與jsconfirm插件相關的資料

熱點內容
iphone音符符號 瀏覽:649
女設計師幾百年不死韓國 瀏覽:245
linux無法生成gbk文件 瀏覽:590
免費的最新電影qq群 瀏覽:83
數控g76螺紋怎麼編程 瀏覽:779
哪個影院不需要VIP 瀏覽:706
百度分享代碼錯誤 瀏覽:920
酷狗網路列表恢復 瀏覽:149
免費天堂網站 瀏覽:667
玉器網站源碼 瀏覽:249
開辟內宇宙超脫的小說 瀏覽:242
第二書包荷包 瀏覽:711
qq什麼版本有辦公應用 瀏覽:815
女主角叫米亞的恐怖片 瀏覽:904
男孩縮小在魚缸里 動漫 瀏覽:111
請檢查文件內容是否正確 瀏覽:109
word轉pdf大文件怎麼打開 瀏覽:447
不顯示u盤文件怎麼回事 瀏覽:691
想^_^香港看啪啪視頻 瀏覽:496
qq群贊賞照片不見了 瀏覽:187

友情鏈接