zoukankan      html  css  js  c++  java
  • 通过jQuery修改ui的顺序

    1.html代码 <ul class="around_list zuijin"></ul>

    2.js代码

     var juli = [
                    {'idx': '1', 'name': '天一阁', 's': 4537, 'juli': 4},
                    {'idx': '2', 'name': '天一广场', 's': 4347, 'juli': 3},
                    {'idx': '3', 'name': '月湖', 's': 4469, 'juli': 2},
                    {'idx': '5', 'name': '天封塔', 's': 3575, 'juli': 3},
                    {'idx': '6', 'name': '鼓楼步行街', 's': 3346, 'juli': 4},
                    {'idx': '7', 'name': '庆安会馆', 's': 3012, 'juli': 5},
                    {'idx': '8', 'name': '七塔寺', 's': 8000, 'juli': 6},
                    {'idx': '9', 'name': '七塔寺11', 's': 5000, 'juli': 6},
                ];

    3.触发事件

      $('.juli_paixu').click(function () {

          $('.zuijin').empty();

      var sageOrder = students.sort(function (a, b) {return (a.juli - b.juli);});

      $.each(sageOrder, function (index, value) {
                        $('.zuijin').append('<li class="list_one">'
                                + '<a href="<?= url(array(_A => 'view', _C => 'dest', 'destid' => $value['destid'])) ?>">'
                                + '<span class="info">'
                                + '<label class="idx">' + value.idx + '</label>'
                                + '<label class="title">' + value.name + '</label>'
                                + '<label class = "juli m" >' + value.s + '</label >'
                                + '</span>'
                                + '</a>'
                                + '</li>');
                    });

  • 相关阅读:
    Android应用签名
    Win7环境下TreeSaver编译环境的搭配
    TreeSaver 使用教程整理——Step 4: Using a Title Figure
    使用jquery获取父元素或父节点的方法
    IIS 错误代码分析手册
    敏捷开发 规范
    Asp.net中时间格式化的几种方法
    在Oracle中使用Guid
    jquery 当前时间
    JQuery一种取同级值的方式 比如你在GridView中如下
  • 原文地址:https://www.cnblogs.com/YTzZ/p/4682855.html
Copyright © 2011-2022 走看看