Skip to content

Commit 53f7f73

Browse files
committed
2-23
1 parent 5f416e0 commit 53f7f73

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

index.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
font-size: 1rem;
8080
text-align: center;
8181
color: cornsilk;
82+
height: 3rem;
8283
}
8384
#b{
8485
text-align: center;
@@ -101,8 +102,8 @@
101102
</figcaption>
102103
</figure>
103104
<div class="ntn">
104-
<button type="button" id="add" class="btn1 am-btn am-btn-default am-radius am-btn-secondary">下一张</button>
105-
105+
<button type="button" id="add" class="btn1 am-btn am-btn-primary am-btn-default am-radius am-btn-secondary">下一张</button>
106+
106107
<div id="clock">
107108
<p class="date">{{ date }}</p>
108109
<p class="time">{{ time }}</p>
@@ -122,18 +123,19 @@
122123
<script src="./js/jquery-3.2.0.min.js"></script>
123124
<script src="./js/amazeui.js"></script>
124125
<script>
126+
125127

126128
var test = document.getElementById('img');
127129

128-
test.dataset.rel = "https://www.bing.com/az/hprichbg/rb/BonifacioCorsica_ZH-CN12276076394_1920x1080.jpg";
129-
130+
test.dataset.rel = "https://www.bing.com/az/hprichbg/rb/SiberianJay_ZH-CN8167378429_1920x1080.jpg";
130131

131132
$(function () {
132133

133134
$.get("https://bird.ioliu.cn/v1/?url=http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1", function (data) {
134135
var text = data.images[0].copyright;
135136
var imgSrc = 'https://www.bing.com' + data.images[0].url
136137
$('#img').attr('src', imgSrc)
138+
$('.am-img-loaded').attr('src', imgSrc)
137139
$('#txt').html(text)
138140
}, 'json');
139141
});
@@ -142,8 +144,8 @@
142144
urlIndex++;
143145
url1 ="http://www.bing.com/HPImageArchive.aspx?format=js&idx=" + urlIndex + "&n=1"
144146
if(urlIndex > 7 ){
145-
alert("没有图片了")
146-
urlIndex--;
147+
$('#add').alert("没有图片了")
148+
urlIndex--;
147149
}else{
148150
$.get('https://bird.ioliu.cn/v1/?url=' + url1, function (data) {
149151

@@ -160,7 +162,7 @@
160162
urlIndex--;
161163
url1 ="http://www.bing.com/HPImageArchive.aspx?format=js&idx=" + urlIndex + "&n=1"
162164
if(urlIndex < -1 ){
163-
alert("没有图片了")
165+
164166
urlIndex++
165167
}else{
166168
$.get('https://bird.ioliu.cn/v1/?url=' + url1, function (data) {

0 commit comments

Comments
 (0)