拖拽,hover,动画常用属性


<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>拖拽,hover,动画title>
    <script type="text/javascript" src="../jquery-3.2.1.min.js">script>

    


    
    <style type="text/css">
    #div1{width: 100px;height: 100px;background: red}
    #div2{width: 100px;height: 100px;background: yellow}
    style>
    <script type="text/javascript">
    $(function(){
        $('#div1').hover(function(){
            //$(this).css('background',"blue");
            //$('#div2').hide(1000);
            //$('#div2').fadeOut(3000);
            //$('#div2').slideUp();
            $('#div2').fadeTo(1000,0.5);
        },function(){
            //$(this).css('background',"red");
            //$('#div2').show(1000);
            //$('#div2').fadeIn(3000);
            //$('#div2').fadeTo(3000);
            //$('#div2').slideDown();
            $('#div2').fadeTo(1000,1);

        });
    });
    script>
head>
<body>
    <div id="div1">div>
    <div id="div2">div>
body>
html>

你可能感兴趣的:(jquery)