Lidy sun

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

Javascript test

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//添加js
function addOuterJs(url) {
var oHead = document.getElementsByTagName('head').item(0);
var oScript = document.createElement("script");
oScript.type = "text/javascript";
oScript.src = url;
oHead.appendChild(oScript);
}
//浏览器检查
if (!belowIe9()) {
addOuterJs('/res/js/global/Sortable.min.js')
var t = setTimeout(function() {
var companySortable = Sortable.create(document.getElementById('j_cartWrap'), {
onEnd: function(e) {
reSortIndex(e.from)
}
});
$('#j_cartWrap .list-gds').each(function(n, item) {
$(item).attr('id', 'list-gds-' + n);
var orderListDragWrap = document.getElementById('list-gds-' + n);
var sortableOrder = new Sortable(orderListDragWrap, {
filter: '.item-dragable-none',
onEnd: function(e) {
reSortIndex(e.from)
},
onFilter: function(evt) {
var $itemEl = $(evt.target);
console.log($itemEl)
}
})
})
}, 500);
console.log('your browser uper Ie9!')
} else {
console.log('your browser below Ie9!')
}
// 拖拽后回调
function reSortIndex(el) {
var $el = $(el);
var $children = $el.children();
$children.each(function(n, item) {
$(item).attr('data-newindex', n)
})
}

More info: Deployment