首页 > 其他 > 详细

十一、Boostrap-X-editable

时间:2019-09-09 10:13:56      阅读:101      评论:0      收藏:0      [点我收藏+]

一、官网 http://vitalets.github.io/x-editable/index.html

技术分享图片

 

 二、实践

在jQuery中ajax配置项中的使用type与method的区别:

type 和method 一样的含义,只是mthod是version1.9添加的,所以版本1.9之前的使用type 之后的使用method。

1、获取Getting Started

 技术分享图片

 

 技术分享图片

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>X-editable starter template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- bootstrap -->
    <link href="https://cdn.bootcss.com/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/2.0.3/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
    <!-- x-editable (bootstrap version) -->
    <!--关键字:bootstrap-editable cdn 版本:1.4.6 -->
    <link href="https://cdn.bootcss.com/x-editable/1.4.6/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/x-editable/1.4.6/bootstrap-editable/js/bootstrap-editable.min.js"></script>
    <!---->
    <script type="text/javascript">
    $(document).ready(function() {  //(function(){})不支持,必须ready才执行
        //toggle `popup` / `inline` mode
        $.fn.editable.defaults.mode = popup;     
        //make username editable
        $(#username).editable();
        //make status editable
        $(#status).editable({
            type: select,
            title: Select status,
            placement: right,
            value: 2,
            source: [
                {value: 1, text: status 1},
                {value: 2, text: status 2},
                {value: 3, text: status 3}
            ]
        });
    });
    </script>
  </head>

  <body>
    <div class="container">
      <h1>X-editable starter template</h1>
      <div>
        <span>Username:</span>
        <a href="#" id="username" data-type="text" data-placement="right" data-title="Enter username">superuser</a>
      </div>
      <div>
        <span>Status:</span>
        <a href="#" id="status"></a>
      </div>  
    </div>
  </body>
</html>

 

十一、Boostrap-X-editable

原文:https://www.cnblogs.com/fger/p/11489772.html

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