jquery plugin(Impromptu)
jquery plugin(Impromptu)
我想知道,如何在我的 HTML 中使用此插件?
$.prompt("Open your javascript console to see the answer.", {
title: "Are you Ready?",
buttons: { "Yes, I'm Ready": true, "No, Lets Wait": false },
submit: function(e,v,m,f){
// use e.preventDefault() to prevent closing when needed or return false.
// e.preventDefault();
console.log("Value clicked was: "+ v);
}
});
该代码来自 http://trentrichardson.com/Impromptu/
我使用那个库,它是工作。
包括库:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="http://trentrichardson.com/Impromptu/jquery-impromptu.js"></script>
.CSS:
<link href="http://trentrichardson.com/Impromptu/jquery-impromptu.css" rel="stylesheet" type="text/css" >
编写脚本:
<script type="text/javascript">
var multiplePromptsCounter = 1;
function openMultiplePrompts(){
$.prompt("Do you want to open another?", {
title: "A Prompt Has Opened: "+ multiplePromptsCounter++,
buttons: { "Yes, Open Another": true, "No, Close This One": false },
persistent: false,
submit: function(e,v,m,f){
if(v){
e.preventDefault();
openMultiplePrompts();
}
}
});
}
</script>
.HTML:
<div class="buttons">
<button class="run" onclick="openMultiplePrompts()" >Run It!</button>
</div>
希望对您有所帮助。
相关文章:
- Ckeditor-plugin:插入虚假元素add不情愿<p>标签前后
- Loopback AngularJS JavaScript SDK - Gruntfile plugin
- 可以't让browserfy使用babel-plugin-transform类属性
- 使用AdMob Plugin Pro时出错
- Jquery Selected plugin - 由 Ajax 动态填充列表
- 在Grails中使用Asset-Pipeline Plugin制作一个视图加载特定的JavaScript
- 来自plugin.google.maps(不是com.google.maps)的标记不会改变其位置
- jquery plugin(Impromptu)
- jquery-plugin-1配置设置从另一个配置设置获取值
- jQuery Accordion plugin - SHOPIFY
- Scrollsnap JQuery Plugin
- plugin iframe-resizer get the parentIFrame
- RequireJS and jQuery plugin
- 如何在jQuery.awesomeCloud.plugin上添加jQuery工具提示功能
- Adobe Javascript Vs. Plugin
- 如何使用Impromptu作为确认警报
- jquery plugin imgpreload
- Chart.js jQuery Plugin
- SublimeLinter - nodeca plugin
- cordova:模块“cordova/plugin/SmsInboxPLugin 未找到