一简答题
1.
答:体积小,压缩后只有100KB左右
强大的选择器
出色的DOM封装
可靠的事件处理机制
出色的浏览器兼容性
使用隐式迭代简化编程
丰富的插件支持
2.
答:jQuery对象就是通过jQuery包装DOM对象后产生的对象,它能够使用jQuery中的方法。
对于一个DOM对象,使用()函数将DOM对象包装起来,就成为一个jQuery对象。
3.
答:jQuery基本语法结构形式为: ( )函数将DOM对象包装起来,就成为一个jQuery对象。3.答jQuery基本语法结构形式为:()函数将DOM对象包装起来,就成为一个jQuery对象。3.答jQuery基本语法结构形式为:(selector).action()。它包含工厂函数$()、选择器 selector和方法action()三部分。
4.
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>图片添加边框</title>
<style>
body{text-align: center;}
</style>
</head>
<body>
<img src="img/pic.gif">
<script type="text/javascript" src="js/js/jquery-1.12.4.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
$("img").click(function(){
$('img').css('border','1px solid #cc');
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>林徽因简介</title>
<style >
body,h1,h2,ul,li,
p{margin: 0; padding: 0; font-family: "black"; line-height: 28px;}
p{ font-size: 14px; text-indent: 2em; display: none;}
ul{display: none;}
h1{text-align: center; line-height: 60px;font-size: 32px; background: #333333; color: #fff; margin-bottom: 5px;}
h2{text-align: center; line-height: 50px;font-size:28px; background: #333333; color: #fff; margin-top: 5px;}
</style>
</head>
<body>
<h1>林徽因简介</h1>
<p>林徽因,女,汉族,原名林徽音,出生于浙江杭州,祖籍福建福州。中国著名建筑家、诗人、作家。人民英雄纪念碑和中华人民共和国国徽深化方案的设计者林徽因是建筑师梁思成的第一任妻子。</p><p>三十年代初,与夫婿梁思成用现代科学方法研究方法研究中国古代建筑,成为这个学术领域的开拓者。</p>
<h2>主要作品</h2>
<ul><li class="current">《你是人间四月天》</li>
<li>《宝莲灯》</li>
<li>《九十九度中》</li></ul>
<script type="text/javascript" src="js/js/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("h1").click(function(){
$("p").show();
});
$("h2").click(function(){
$("ul").show();
});
})
</script>
</body>
</html>