0
我該如何讓這段代碼滑出?當我點擊按鈕時,div滑出,但按鈕本身不會移動。另外我怎樣才能讓圖像和文字形成兩列?當使用我的IDE時,它顯示爲兩列,但在我的網站上沒有。如何獲得此滑塊的工作?
謝謝!
$(document).ready(function() {
$('.rec-anime-button').click(function() {
if (parseInt($('.rec-anime-list-container').css('right')) < 0) {
$('.rec-anime-list-container').css('right', '5px');
$('.rec-anime-button').css('right', '500');
} else {
$('.rec-anime-list-container').css('right', '-490px');
$('.rec-anime-button').css('right', '0');
}
});
});
.rec-anime-button {
position: fixed;
margin-top: 100px;
right: 0;
z-index: 1000000;
}
.rec-anime-list-container {
position: fixed;
margin-top: 100px;
right: -490px;
text-decoration: none;
transition: right 300ms ease-in-out;
z-index: 1000000;
}
.rec-anime-list {
max-width: 480px;
text-decoration: none;
}
.container li {
float: left;
width: 230px;
margin-right: 10px;
margin-bottom: 10px;
text-decoration: none;
}
.column {
display: inline-block;
vertical-align: middle
}
.rec-anime-title {
margin-top: 0;
color: gray;
width: 100px;
}
.sub {
color: blue;
font-size: 16px;
}
.dub {
color: red;
font-size: 16px;
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Recommended Anime Slider -->
<div class="rec-anime-button">
<img src="/Rec-Anime-button.png">
</div>
<div class="rec-anime-list-container">
<ul class="rec-anime-list container">
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="sub">[Sub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120xTITLE80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="dub">[Dub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="sub">[Sub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="dub">[Dub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="sub">[Sub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="dub">[Dub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="sub">[Sub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="dub">[Dub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="sub">[Sub]</strong>
</div>
</li>
<li>
<a href="#">
<div class="column">
<img src="http://dummyimage.com/120x80/000/fff" />
</div>
</a>
<div class="column rightcol">
<p class="rec-anime-title">TITLE</p><strong class="dub">[Dub]</strong>
</div>
</li>
</ul>
</div>
非常感謝!這工作好很多。 –
問題:這是網站:www.otakume.net 這些列仍然不起作用並顯示項目符號點。我該如何解決? –
@OtakuMe嘗試更新的one.and如果有幫助,則將其標記爲幫助稍後訪問者的答案。 –