JQuery 實現 圖片滑動收起與隱藏

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jq183.js"></script>
</head>
<body>
<input type="button" id="down" value="slideDown">
<input type="button" id="up" value="slideUp">
<input type="button" id="toggle" value="slideToggle">
<br>
<hr>
<img src="./flower1.jpg" alt="" id="re">
</body>
<script>
    //給指定按鈕綁定單擊事件 實現圖片滑動收起和隱藏
    $('#down').click(function(){
        $('#re').slideDown(3000,function(){
            alert('我來啦!');
        });
    })
    $('#up').click(function(){
        $('#re').slideUp(3000,function(){
            alert('我走啦!');
        });
    })

    $('#toggle').click(function(){
        $('#re').slideToggle(3000,function(){
            alert('biubiubiu');
        });
    })
</script>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章