欢迎使用CSDN-markdown编辑器

来源:互联网 发布:后二计划软件 编辑:程序博客网 时间:2024/06/08 18:35
<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>dialog</title><link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"><script src="//code.jquery.com/jquery-1.9.1.js"></script><script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script><link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css"><script type="text/javascript">    $(function() {        //第一种方式        $("#dialog1").dialog({            resizable : false,            height : 300,            position : [200,100],            modal : true,            buttons : {                "确定" : function() {                    $(this).dialog("close");                },                "取消" : function() {                    $(this).dialog("close");                }            }        }).show();        //第二种方式 中英文方式        var lang = "en";  //中文zh 英文en        var str1 = {                en : "sure",                zh : "确定"        };        var str2 = {                en : "cancel",                zh : "取消"        };        var buttons = {};        var btn1 = "";        var btn2 = "";        if(lang == "en"){            btn1 = str1.en;            btn2 = str2.en;        }else{            btn1 = str1.zh;            btn2 = str2.zh;        }        buttons[btn1] = function() {            $( this ).dialog( "close" );        };        buttons[btn2] = function() {            $( this ).dialog( "close" );        };        $("#dialog2").dialog({            resizable : false,            height : 300,            position : [600,100],            modal : true,            buttons : buttons        }).show();    });</script></head><body>    <div id="dialog1" title="dialog测试数据">dialog1</div>    <div id="dialog2" title="dialog测试数据">dialog2</div></body></html>
0 0
原创粉丝点击