三维聚源
2016-04-17 16:39
239 查看
1.有如下代码,请说出程序的运行结果
弹出21
2.略
3.有如下代码,请说出两块div的尺寸和Hello word的颜色。
box宽100%
cotent宽400px
Hello word为蓝色
具体原因为:http://www.cnblogs.com/flyings/p/5401410.html
4.实现轮播图,分别用js和css3
js实现
css3实现
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> </head> <body> <script type="text/javascript"> var a=0;//第一步:a=0; setTimeout( function(){ alert(++a);//第三步:a=21; a=100; },100 ); a=20;//第二步:a=20; </script> </body> </html>
弹出21
2.略
3.有如下代码,请说出两块div的尺寸和Hello word的颜色。
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> #cotent{width: 400px;} div{width: 100%;} .box>div{width: 200px;} .block{width:300px;} .red{color: red;} .blue{color:blue;} </style> </head> <body> <div class="box"> <div id="cotent" class="blue block red"> hello </div> </div> </body> </html>
box宽100%
cotent宽400px
Hello word为蓝色
具体原因为:http://www.cnblogs.com/flyings/p/5401410.html
4.实现轮播图,分别用js和css3
js实现
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="js/jquery-2.1.4.min.js" ></script> <style type="text/css"> #box{width: 400px; position:relative; overflow: hidden; background-color: red; height: 200px; } #picShow{width: 1200px; height: 200px; background-color: #fff; position: absolute; } #picShow img{width:400px; float:left; } </style> </head> <body> <div id="box"> <div id="picShow"> <img alt="" src="images/1.jpg" /> <img alt="" src="images/2.jpg" /> <img alt="" src="images/3.jpg" /> </div> </div> <script type="text/javascript"> function move(){ $("#picShow").animate({marginLeft:-400},"slow",function() { $("#picShow img:last").after($("#picShow img:first")) $("#picShow").css({marginLeft:0}) }) } setInterval(move,2000) </script> </body> </html>
css3实现
暂无
相关文章推荐
- 软件设计模式:代理(Proxy)模式
- 【matlab】:matlab实现对一个图片进行平移
- 图片述说JVM运行时的故事(下)
- iOS Responder Chain 响应者链
- C++实验3—多分数段函数求值
- 机电传动第八周学习笔记
- 2016 4 16月赛B题
- 手机总流量统计
- Little-Endian or Bigger-Endian?
- Python 集合(set)类型的操作
- Learning Scrapy笔记(六)- Scrapy处理JSON API和AJAX页面
- PHP实现当前文件夹下所有文件和文件夹的遍历
- [HDOJ1171]Big Event in HDU(01背包)
- zoj 3903 Ant【推公式+逆元】
- javascript中textContent与innerText的异同分析
- 自定义多状态高仿应用下载百分数view
- web基础
- Android音频开发(6):使用 OpenSL ES API(上)
- 第五种项目四-长方柱类
- 水电费