首页 > 其他 > 详细

easyUI学习笔记一

时间:2019-06-08 16:23:21      阅读:110      评论:0      收藏:0      [点我收藏+]

1.引用js文件

技术分享图片
    <script type="text/javascript" src = jquery-easyui/jquery.min.js> </script>
    <script type="text/javascript" src = jquery-easyui/jquery.easyui.min.js> </script>
    <script type="text/javascript" src = jquery-easyui/locale/easyui-lang-zh_CN.js> </script>
    <script type="text/javascript" src ="index.js"></script>  <!-- 自定义js -->
View Code

2.引用css文件

技术分享图片
<link rel="stylesheet"  href="jquery-easyui/themes/default/easyui.css">
    <link rel="stylesheet"  href="jquery-easyui/themes/icon.css">
View Code

3.第一个demo

技术分享图片
<!DOCTYPE html>
<html>
<head>
    <title>easyui学习</title>
    <script type="text/javascript" src = jquery-easyui/jquery.min.js> </script>
    <script type="text/javascript" src = jquery-easyui/jquery.easyui.min.js> </script>
    <script type="text/javascript" src = jquery-easyui/locale/easyui-lang-zh_CN.js> </script>
    <link rel="stylesheet"  href="jquery-easyui/themes/default/easyui.css">
    <link rel="stylesheet"  href="jquery-easyui/themes/icon.css">
</head>
<body>
<div class="easyui-dialog" style="width:500px;height:500px" data-options="title:‘标题 ‘,collapsible:true,iconCls:‘icon-ok‘">
内容部分</div>

</body>
</html>
View Code

4.js调用dialog

技术分享图片
   <div id ="box" title="标题" style="width:500px;height:500px">
        内容部分
  </div>
View Code
技术分享图片
$(function(){
    $(‘#box‘).dialog();
})
View Code

技术分享图片

 

5.可拖动

技术分享图片
$(function(){

         $(‘#box‘).draggable();

})
View Code

6.拖放Droppable

技术分享图片
<!DOCTYPE html>
<html>
<head>
    <title>easyui学习</title>
    <script type="text/javascript" src = jquery-easyui/jquery.min.js> </script>
    <script type="text/javascript" src = jquery-easyui/jquery.easyui.min.js> </script>
    <script type="text/javascript" src = jquery-easyui/locale/easyui-lang-zh_CN.js> </script>

    <script type="text/javascript" src ="index.js"></script>  <!-- 自定义js -->

    <link rel="stylesheet"  href="jquery-easyui/themes/default/easyui.css">
    <link rel="stylesheet"  href="jquery-easyui/themes/icon.css">
</head>
<body>
<div id="dd"  style="width: 600px;height: 600px;background-color:red;" ></div>

  <div id ="box" title="标题" style="width:500px;height:500px;background-color: green;">
        <span id="span">内容部分</span>
  </div>

<!--    <div id ="box" title="标题" style="width:500px;height:500px">
        内容部分
  </div> -->
</div>
        
</body>
</html>
View Code
技术分享图片
$(function(){
$("#dd").droppable({
accept:‘#box‘,
onDragEnter:function(e,source){
  $(this).css("background-color",‘blue‘);
},
onDragLeave:function(e,source){
  $(this).css("background-color",‘red‘);
}
});

    $(‘#box‘).draggable();
})
View Code

 

easyUI学习笔记一

原文:https://www.cnblogs.com/SoftWareIe/p/10990808.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!