X Tutup
Skip to content

Commit cb0c81f

Browse files
committed
update
1 parent 9cc29b5 commit cb0c81f

File tree

12 files changed

+47
-33
lines changed

12 files changed

+47
-33
lines changed

.DS_Store

0 Bytes
Binary file not shown.

cutter/.DS_Store

0 Bytes
Binary file not shown.

cutter/cutter/.DS_Store

0 Bytes
Binary file not shown.

cutter/src/.DS_Store

6 KB
Binary file not shown.

jQuery-free/.DS_Store

0 Bytes
Binary file not shown.

jQuery-free/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727

2828
if (opts.type == 'get') {
2929
params = formatParams(opts.data);
30-
xhr.open('get', opts.url + '?' + params, true);
30+
var url = opts.url.indexOf('?') > -1 ? (opts.url + '&' + params) : (opts.url + '?' + params);
31+
xhr.open('get', url, true);
3132
opts.headers && setHeaders();
3233
xhr.send(null);
3334
} else if (opts.type == 'post') {

waterFall/.DS_Store

0 Bytes
Binary file not shown.

waterFall/css/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ html, body {
3333
background-image: url(../resource/images/banner.jpg);
3434
}
3535

36+
.load-more {
37+
text-align: center;
38+
padding: 10px 0 15px 0;
39+
}
40+
3641
.guide {
3742
width: 100%;
3843
position: absolute;

waterFall/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
<div class="banner">
1717
<p class="guide">点击这里切换类型</p>
1818
</div>
19-
<div class="content">
20-
<div style="float:left;width:20%;padding-bottom:40%;background-color:blue"></div>
21-
<div style="float:right;width:80%;padding-bottom:40%;background-color:red"></div>
22-
</div>
19+
<div class="content"></div>
20+
<div class='load-more'>加载更多</div>
2321
</div>
2422
</body>
2523
<script src="./wf/wf.js"></script>

waterFall/js/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
window.onload = function() {
55

6-
return;
76
var dataArr = [
87
{picUrl: './resource/images/dota-4.jpg', width: 480, height: 800},
98
{picUrl: './resource/images/dota-15.jpg', width: 500, height: 311},
@@ -32,8 +31,10 @@ window.onload = function() {
3231
];
3332

3433
var listType = 1,
35-
bannerDom = document.getElementsByClassName('banner')[0],
36-
contentDom = document.getElementsByClassName('content')[0];
34+
bannerDom = document.querySelector('.banner'),
35+
contentDom = document.querySelector('.content'),
36+
loadMoreDom = document.querySelector('.load-more'),
37+
wtf = null;
3738

3839
showList();
3940

@@ -43,9 +44,13 @@ window.onload = function() {
4344
showList();
4445
}
4546

47+
loadMoreDom.onclick = function() {
48+
wtf.create(dataArr);
49+
}
50+
4651
function showList() {
4752
contentDom.innerHTML = '';
48-
var wtf = new WaterFull('.content', {
53+
wtf = new WaterFull('.content', {
4954
type: listType,
5055
urlField: 'picUrl'
5156
});

0 commit comments

Comments
 (0)
X Tutup