artDialog使用说明(弹窗API)
2.
备注:1、元素不是复制而是完整移动到对话框中,所以原有的事件与属性都将会保留 2、如果隐藏元素被传入到对话框,会设置display:block属性显示该元素 3、对话框关闭的时候元素将恢复到原来在页面的位置,style display属性也将恢复
********************************************************************************************
只前这个东东也是朋友完我的,后来经刚刚一位朋友提醒,我google一下,现在完整的教程都在里面,所有包都在里面。
我也不好意思,现在补充下。呵呵,因为不算晚吧。
art.dialog({
content: document.getElementByIdx_x_x('demoCode_content_DOM'),
id: 'EF893L'
});
效果:把指定的div加载到这个弹框上
标题 [title]
art.dialog({
title: 'hello world!'
});
效果:
确定取消按钮 [ok & cancel]
备注:回调函数this指向扩展接口,如果返回false将阻止对话框关闭
art.dialog({
content: '如果定义了回调函数才会出现相应的按钮',
ok: function () {
this.title('3秒后自动关闭').time(3);
return false;
},
cancelVal: '关闭',
cancel: true //为true等价于function(){}
});
创建一个全屏对话框
art.dialog({
width: '100%',
height: '100%',
left: '0%',
top: '0%',
fixed: true,
resize: false,
drag: false
})
效果图:
artDialog.notice = function (options) {
var opt = options || {},
api, aConfig, hide, wrap, top,
duration = 800;
var config = {
id: 'Notice',
left: '100%',
top: '100%',
fixed: true,
drag: false,
resize: false,
follow: null,
lock: false,
init: function(here){
api = this;
aConfig = api.config;
wrap = api.DOM.wrap;
top = parseInt(wrap[0].style.top);
hide = top + wrap[0].offsetHeight;
wrap.css('top', hide + 'px')
.animate({top: top + 'px'}, duration, function () {
opt.init && opt.init.call(api, here);
});
},
close: function(here){
wrap.animate({top: hide + 'px'}, duration, function () {
opt.close && opt.close.call(this, here);
aConfig.close = $.noop;
api.close();
});
return false;
}
};
for (var i in opt) {
if (config[i] === undefined) config[i] = opt[i];
};
return artDialog(config);
};
调用示例:
art.dialog.notice({
title: '万象网管',
width: 220,// 必须指定一个像素宽度值或者百分比,否则浏览器窗口改变可能导致artDialog收缩
content: '尊敬的顾客朋友,您IQ卡余额不足10元,请及时充值',
icon: 'face-sad',
time: 5
});
跨域访问
跨域访问无法自适应大小,也无法进行父页面与子页面数据交换
art.dialog.open('http://www.connect.renren.com/igadget/renren/index.html',
{title: '人人网', width: 320, height: 400});
art.dialog.open('googleMaps.html');
1.导入<script
src="http://blog.163.com/penglie_520/blog/artDialog/artDialog.js?skin=default"></script>
2.加上
Js代码
(function (config) {
config['lock'] = true;
config['fixed'] = true;
config['okVal'] = 'Ok';
config['cancelVal'] =
'Cancel';
//
[more..]
})(art.dialog.defaults);//这个是用哪个主题有很多主题的你把名字打上就行啦
**********************这是googleMap的代码Copy就行啦没有问题有问题给我留言不懂就问只要你问我就说***********************************
Js代码
<!doctype
html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0,
user-scalable=no"
/>
<style>
html { height: 100% }
body { height: 100%; margin: 0; padding: 0; background-color: #FFF
}
#map_canvas { height: 100%
}
</style>
<script
src="http://maps.googleapis.com/maps/api/js?sensor=false&language=zh_CN"></script>
<script>
var map, geocoder;
function initialize() {
var latlng = new google.maps.LatLng(39.904214,
116.407413);
var options = {
zoom: 11,
center: latlng,
disableDefaultUI: true,
panControl: true,
zoomControl: true,
mapTypeControl: true,
scaleControl: true,
streetViewControl: false,
overviewMapControl: true,
mapTypeId:
google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementByIdx_x("map_canvas"),
options);
geocoder = new
google.maps.Geocoder();
geocoder.geocode({latLng: latlng}, function(results, status)
{
if (status == google.maps.GeocoderStatus.OK)
{
if (results[3]) {
document.getElementByIdx_x("map_address").value =
results[3].formatted_address;
}
}
});
var dialog =
art.dialog.open.api;
dialog.title('google
mpas')
.size(558, 360)
.button({name: '截图', callback: function ()
{
var center = map.getCenter().lat() + ',' +
map.getCenter().lng(),
zoom = map.getZoom(),
maptype =
map.getMapTypeId(),
url =
'http://maps.googleapis.com/maps/api/staticmap';
url += '?center=' +
encodeURIComponent(center);
url += '&zoom=' +
encodeURIComponent(zoom);
url +=
'&size=558x360';
url += '&maptype=' +
encodeURIComponent(maptype);
url += '&markers=' +
encodeURIComponent(center);
url +=
'&language=zh_CN';
url +=
'&sensor=false';
art.dialog.through({title: false, content: '<img
src="http://blog.163.com/penglie_520/blog/' + url + '"
/>', padding: 0, width: 558, height: 360, lock:
true});
return false;
}, focus: true})
.position('50%',
'goldenRatio');
document.getElementByIdx_x("map-search-sumbit").onclick = function ()
{
var input =
document.getElementByIdx_x('map_address');
search(input.value);
};
}
function search(address)
{
if (!map) return;
geocoder.geocode({address : address}, function(results, status)
{
if (status == google.maps.GeocoderStatus.OK)
{
map.setZoom(11);
map.setCenter(results[0].geometry.location);
var marker = new
google.maps.Marker({
map: map,
position:
results[0].geometry.location
});
} else {
alert("Invalid address: " +
address);
}
});
}
</script>
</head>
<body onLoad="initialize();" style="font: 12px/1.11
'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti;
_font-family:Tahoma,Arial,Helvetica,STHeiti; -o-font-family:
Tahoma,
Arial;">
<div style="width:100%;
height:100%">
<table
style="width:100%;height:100%;">
<tr>
<td
style="height:38px"><div
style="margin:5px;">地址:
<input id="map_address" value=""
style="width:200px; padding:4px;">
<button id="map-search-sumbit">搜
索</button></div></td>
</tr>
<tr>
<td
style="height:100%"><div
id="map_canvas" style="height:100%; margin:0
5px"></div></td>
</tr>
</table>
</div>
</body>
</html>
artDialog使用说明(弹窗API)的更多相关文章
- (转)jQuery验证控件jquery.validate.js使用说明+中文API
官网地址:http://bassistance.de/jquery-plugins/jquery-plugin-validation jQuery plugin: Validation 使用说明 转载 ...
- jQuery验证控件jquery.validate.js使用说明+中文API
官网地址:http://bassistance.de/jquery-plugins/jquery-plugin-validation jQuery plugin: Validation 使用说明 学习 ...
- query.validate.js使用说明+中文API
转自:http://www.cnblogs.com/hejunrex/archive/2011/11/17/2252193.html 看到一篇好的文章不容易,记录下来以防丢失! 官网地址:http:/ ...
- jQuery验证控件jquery.validate.js使用说明+中文API(转)
一导入js库<script src="../js/jquery.js" type="text/javascript"></script> ...
- artDialog基本使用
artDialog是一个基于javascript编写的对话框组件,它拥有精致的界面与友好的接口l 自适应内容artDialog的特殊UI框架能够适应内容变化,甚至连外部程序动态插入的内容它仍然能自适 ...
- [WinAPI] API 5 [遍历驱动器并获取驱动器属性]
(1) GetLogicalDrives.获取主机中所有的逻辑驱动器,以BitMap的形式返回.◇返回值GetLogicalDrive函数返回一个DWORD类型的值,第一位表示所对应的驱动器是否存在. ...
- jquery.validate.js使用说明——后台添加用户邮箱功能:非空、不能重复、格式正确
重点内容为: jQuery验证控件jquery.validate.js使用说明+中文API[http://www.tuicool.com/articles/iABvI3] 简单教程可以参考[jQue ...
- artDialog ( v 6.0.2 ) content 参数引入页面 html 内容
/*! artDialog v6.0.2 | https://github.com/aui/artDialog */ 将页面某一隐藏的 div 的 html 内容传到 artdialog 的弹窗中,并 ...
- springboot06-swagger2 自动化api文档
1.springboot 项目中添加swagger2依赖: <dependency> <groupId>org.springframework.boot</groupId ...
随机推荐
- halcon 使用elliptic_axis计算规则矩形角度
elliptic_axis算子是用于计算与Region等价椭圆的相关参数的,注意必须使用规则矩形!!!,不规则区域想其他办法比如模板匹配. elliptic_axis (Region, Ra, Rb, ...
- 解决vuex requires a Promise polyfill in this browser问题
造成这种现象的原因归根究底就是浏览器对ES6中的promise无法支持,因此需要通过引入babel-polyfill来是我们的浏览器正常使用es6的功能 首先通过npm来安装: npm install ...
- imageNamed和dataWithContentsOfFile的区别(1)
imageNamed和dataWithContentsOfFile的区别 imagecacheuiviewextensionprocessingxcode 最近老是受iphone内存问题的困扰,找了些 ...
- 轻量ORM-SqlRepoEx (七)AspNetCore应用
ORM-SqlRepoEx 是 .Net平台下兼容.NET Standard 2.0,一个实现以Lambda表达式转转换标准SQL语句,使用强类型操作数据的轻量级ORM工具,在减少魔法字串同时,通过灵 ...
- Spark Streaming编程示例
近期也有开始研究使用spark streaming来实现流式处理.本文以流式计算word count为例,简单描述如何进行spark streaming编程. 1. 依赖的jar包 参考<分别用 ...
- ABI是什么? Swift ABI稳定有什么好处?
ABI是什么? 在软件开发中, 应用程序机器二元码界面(Application Binary Interface 简称ABI)指两个程序模块间的接口; 通常其中一个车还给你徐模块会是库或者操作系统提供 ...
- Error Note1:错误修复笔记
1.遍历同时修改数组内容导致崩溃 bugly上bug提醒如下图所示,经检查发现,可能是页面上数据加载惹得祸. 页面加载过程是这样的,首先进入页面,初始化页面,将本地数据加载到array中刷新table ...
- 20181030NOIP模拟赛T2
WYT的刷子 WYT有一把巨大的刷子,刷子的宽度为M米,现在WYT要使用这把大刷子去粉刷有N列的栅栏(每列宽度都为1米:每列的高度单位也为米,由输入数据给出). 使用刷子的规则是: 1.与地面垂直,从 ...
- ACM 2000~2002
ACM 2000 输入三个字符后,按各个字符的ASCⅡ码从小打到的顺序输出这三个字符. import java.util.Scanner; public class Lengxc {public ...
- 第3章 jQuery中的DOM操作
parent() .parents().closest() 区别示例: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiona ...