jQueryを使用animate()
していますが、機能しません。divを取得して、それを含み、を含む別のdivをスライドさせようとしていoverflow:hidden
ます。私はleft
アニメーションと何ものすべての組み合わせを試しました。念のため、div(ギャラリー)の幅も変更してみましたが、幅は変更されますが、左は変更されません。
私は何が間違っているのですか?
function an() {
//$('#gallery').fadeOut();
//$('#gallery').animate({left:'-=1000'},'slow');
$('#gallery').animate({
'left': '+=100px'
}, 'slow');
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div align="center" style="position:relative; height:137px; overflow:hidden; width:1000px; border:3px solid #ff0000;">
<div id="gallery" style="background-color:#033; width:100px; height:137px;"></div>
</div>
<a href="#" onclick="an(); return false;">test</a>