Blogger Information
Blog 32
fans 0
comment 0
visits 21392
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
4月4日作业
inhylei
Original
585 people have browsed it

代码

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
    <style type="text/css">
     .box {
     background: skyblue;
     width: 500px;
     height: 500px;
     margin:20px auto;


     }
     .box img {
     position: relative;
     top: 100px;
     left:100px;
     }
    </style>

</head>
<body>
<div><img src="/180329/images/1.jpg" width="150" alt="shuge" title="mingxing" id="pic"></div>


<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>
<script type="text/javascript">
// attr()

// var res = $('#pic').attr('src')

// $('#pic').attr('width','200')
// $('#pic').attr('style','box-shadow:3px 3px 3px #888;border-radius:50%')
// 

//css()
var res = $('#pic').css('width')
var res = $('#pic').css('width','100px')
$('#pic').css('width','+=150')
$('#pic').css('border','solid 2px #888')
$('#pic').css('border-radius','50%')
var res = $('#pic').css('width')
var res = parseInt(res)
res += 50
$('#pic').css('width',res+'px')



//height()  width()
// $('#pic').height(150)
// $('#pic').height('+=50')
// $('#pic').width(140)
        // $('#pic').width('+=50')
       
        
        // offset()
        //$('.box').offset() 
        //$('.box').offset().left
        //$('.box').offset().top
        //
        
        //position()
        //$('.box').posittion().top
        //$('.box').posittion().left









//控制台输出结果
console.log(res)
</script>
</body>
</html>

手抄


QQ图片20180408203612.jpg

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post