Js代码

2.

传入HTMLElement   
备注:1、元素不是复制而是完整移动到对话框中,所以原有的事件与属性都将会保留 2、如果隐藏元素被传入到对话框,会设置display:block属性显示该元素 3、对话框关闭的时候元素将恢复到原来在页面的位置,style display属性也将恢复   
  
********************************************************************************************   
 
art.dialog({   
    content: document.getElementByIdx_x_x('demoCode_content_DOM'),   
    id: 'EF893L'  
}); 
 效果:把指定的div加载到这个弹框上

JS代码

标题 [title]   
art.dialog({   
    title: 'hello world!'  
});
效果:

Js代码

确定取消按钮 [ok & cancel]   
备注:回调函数this指向扩展接口,如果返回false将阻止对话框关闭   
art.dialog({   
    content: '如果定义了回调函数才会出现相应的按钮',   
    ok: function () {   
        this.title('3秒后自动关闭').time(3);   
        return false;   
    },   
    cancelVal: '关闭',   
    cancel: true //为true等价于function(){}   
}); 

Js代码

创建一个全屏对话框   
art.dialog({   
    width: '100%',   
    height: '100%',   
    left: '0%',   
    top: '0%',   
    fixed: true,   
    resize: false,   
    drag: false  
})
效果图:

Js代码
右下角滑动通知   
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  
});  
效果:模仿网吧右下角通知  带动画效果5秒后自动消失

Js代码

跨域访问   
跨域访问无法自适应大小,也无法进行父页面与子页面数据交换   
art.dialog.open('http://www.connect.renren.com/igadget/renren/index.html',   
    {title: '人人网', width: 320, height: 400}); 

Js代码
加载googleMAP   
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;  
#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>

正在创建模型,此时不可使用上下文“的解决办法

art.dialog 使用说明的更多相关文章

  1. js库之art.dialog

    自适应内容 artDialog的特殊UI框架能够适应内容变化,甚至连外部程序动态插入的内容它仍然能自适应,因此你不必去考虑消息内容尺寸使用它.它的消息容器甚至能够根据宽度让文本居中或居左对齐——这一切 ...

  2. art.dialog 与 ajax 异步请求

    上周写了一些代码,涉及到jquery异步请求,这里归纳总结下,希望对刚接触编程的同学有帮助. 主要习惯使用 art.dialog 框架,非常好用,在异步请求上,它提供了很多简便的方法. 加载使用art ...

  3. art.dialog

    关闭指定弹出窗: art.dialog({ id: 'hetong' }).close(); 关闭所有的iframe弹出窗,art.dia.close();

  4. art.dialog 返回提示

    <form  target="_top"  /> 1 如果加   target="_top" 提示跳出子页面 2 如果不加则在子页面提示

  5. art.dialog.art 中,将子页面窗口中的值传递给父框架中

    artDialog.open.origin.document.getElementById('父元素ID').value=document.getElementById('子页面元素ID').valu ...

  6. dialog统一标准调用方法(内部记录)

    更新base-config.js 对话框统一为三种形式(如后期需要再添加其他方式) //对话框--确定取消 //dialogOkFun:确定函数 dialogCancelFun:取消函数 functi ...

  7. 推荐一款不错的dialog小工具:artDialog

    推荐一款不错的dialog小工具, 地址:http://www.planeart.cn/demo/artDialog/_doc/labs.html 相关介绍例如以下: artDialog是一个基于ja ...

  8. dialog组件的jquery封装实现

    (function($){ $.extend({ Dialog : function(id, options){ var option = $.extend({}, options); option. ...

  9. artDialog使用说明(弹窗API)

    Js代码 2. 传入HTMLElement    备注:1.元素不是复制而是完整移动到对话框中,所以原有的事件与属性都将会保留 2.如果隐藏元素被传入到对话框,会设置display:block属性显示 ...

随机推荐

  1. MVC ---- 如何扩展方法

    先定义一个扩展类: public static class StringExtend { //扩展一个string的方法 public static bool IsNullOrEmpty(this s ...

  2. 如何理解并正确使用MySql索引

    原文链接:https://my.oschina.net/feinik/blog/1305784 1.概述 索引是存储引擎用于快速查找记录的一种数据结构,通过合理的使用数据库索引可以大大提高系统的访问性 ...

  3. java 从List中随机取出一个元素

    java 从List中随机取出一个元素 List<Integer> list = new ArrayList<>(); Random random = new Random() ...

  4. Window系统下用Ant实现Java项目的自动构建和部署

    https://blog.csdn.net/xinxin19881112/article/details/7297021 Step 1: 从官网下载Ant包,官网地址http://ant.apache ...

  5. Qt5.3.2_CentOS6.4_x86_编程调试环境【勿删,简洁】

    ZC:使用的虚拟机环境是:博客园VMwareSkill 的 “CentOS6.4x86EngCustomize120g__20160307.rar” 1. For Qt5.3.2: 基本需要的 软件包 ...

  6. Eclipse打JAR包,插件FatJar安装与使用

    下载fatJar插件,解压缩后是一个.../plugins/(net...)把plugins下面的(net..)文件夹拷贝到eclipse 的plugins下,重新启动Eclipse3.1,Windo ...

  7. C#对config配置文件的管理

    应用程序配置文件,对于asp.net是 web.config,对于WINFORM程序是App.Config(ExeName.exe.config). 配置文件,对于程序本身来说,就是基础和依据,其本质 ...

  8. ArcGIS API for Windows Phone开发实例(4):点击查看超市信息 --- 关于使用InforWindow

    菩提老王的葡萄架:作品 地址:http://blog.newnaw.com/?p=696

  9. LeetCode--168--Excel表列名称

    问题描述: 给定一个正整数,返回它在 Excel 表中相对应的列名称. 例如, 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 ...

  10. Sonya and Ice Cream CodeForces - 1004E 树的直径, 贪心

    题目链接 set维护最小值贪心, 刚开始用树的直径+单调队列没调出来... #include <iostream>#include <cstdio> #include < ...