批改状态:合格
老师批语:
代码
<!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>手抄

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号