Spaces:
Running
Running
jiarongqiu commited on
Commit ·
66bb36a
1
Parent(s): 6e0a67e
update
Browse files- index.html +2 -2
- style.css +1 -1
index.html
CHANGED
|
@@ -121,9 +121,9 @@ $('#searchInput').keypress(function(e) {
|
|
| 121 |
});
|
| 122 |
$('#searchInput').on('input', function() {
|
| 123 |
if ($(this).val().length > 0) {
|
| 124 |
-
$('#searchBox').css('width', '200px');
|
| 125 |
-
} else {
|
| 126 |
$('#searchBox').css('width', '150px');
|
|
|
|
|
|
|
| 127 |
$('#suggestionContainer').hide();
|
| 128 |
}
|
| 129 |
});
|
|
|
|
| 121 |
});
|
| 122 |
$('#searchInput').on('input', function() {
|
| 123 |
if ($(this).val().length > 0) {
|
|
|
|
|
|
|
| 124 |
$('#searchBox').css('width', '150px');
|
| 125 |
+
} else {
|
| 126 |
+
$('#searchBox').css('width', '100px');
|
| 127 |
$('#suggestionContainer').hide();
|
| 128 |
}
|
| 129 |
});
|
style.css
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
}
|
| 8 |
|
| 9 |
#searchBox {
|
| 10 |
-
width:
|
| 11 |
transition: width 0.3s; /* 宽度变化的过渡效果 */
|
| 12 |
}
|
| 13 |
|
|
|
|
| 7 |
}
|
| 8 |
|
| 9 |
#searchBox {
|
| 10 |
+
width: 100px; /* 初始宽度 */
|
| 11 |
transition: width 0.3s; /* 宽度变化的过渡效果 */
|
| 12 |
}
|
| 13 |
|