云南农职《JavaScript交互式网页设计》 综合机试试卷⑥——简易旅游网

川长思鸟来 2022-12-24 14:57 17阅读 0赞

本页面分为顶部导航、登录注册栏,中部图片展示、主体内容和底部反馈模板

一、导航栏部分

要求一:设置菜单栏(二级菜单)和登录注册模块

20201128235820740.png

要求二:当鼠标悬停到菜单栏(一级菜单)时,二级菜单以滑动效果滑出显示,鼠标离开菜单栏(一级菜单)时,以滑动效果滑入隐藏

20201128235829611.png

二、图片展示

要求:设置背景图片,当鼠标点击图片时切换为另一张图片(图片自选)

20201128235848844.png

点击后切换为另一张

20201128235854917.png

三****主体内容

要求**:设置主体内容模块(如图),给菜单栏”美国”的背景颜色设置为橙色,当点击菜单栏时,点击的那一个菜单栏背景颜色变为橙色其他的菜单栏背景颜色去掉**并且菜单栏下方的内容会发生相应的改变.

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDg5MzkwMg_size_16_color_FFFFFF_t_70

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDg5MzkwMg_size_16_color_FFFFFF_t_70 1

四、底部反馈备案栏

要求:写出大致底部内容,文本居中

20201128235929782.png

整体图

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDg5MzkwMg_size_16_color_FFFFFF_t_70 2

五、评分标准
























得分情况

 

一:导航栏(30)

写出整体结构得15分,菜单栏滑入滑出效果15分

二:图片展示(20)

图片正常设置并显示得10分,点击图片能够切换另一张图片得10分

三:主体部分(40)

写出整体结构得20分,点击菜单栏能够切换背景颜色得10分,点击菜单栏,下方内容能够切换得10分

四: 底部反馈备案栏(1)

写出整体结构得5分,文本内容居中5分

六、实现代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <script src="js/jquery-3.4.1.js"></script>
  8. <title>Document</title>
  9. <style>
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. .nav {
  15. width: 100%;
  16. height: 60px;
  17. background-color: rgb(241, 238, 238);
  18. }
  19. .nav ul li {
  20. margin-right: 2px;
  21. background-color: orange;
  22. height: 60px;
  23. line-height: 60px;
  24. text-align: center;
  25. width: 240px;
  26. list-style: none;
  27. float: left;
  28. }
  29. .nav ul li ul {
  30. position: relative;
  31. top: 1px;
  32. display: none;
  33. }
  34. .nav .nav_right {
  35. margin-right: 10px;
  36. float: right;
  37. }
  38. .img {
  39. display: table;
  40. margin-bottom: 10px;
  41. margin-top: 5px;
  42. width: 100%;
  43. height: 380px;
  44. background-image: url("img/ly1.jpg");
  45. background-repeat: no-repeat;
  46. }
  47. .content {
  48. width: 1200px;
  49. height: 400px;
  50. border: 1px solid rgb(230, 227, 227);
  51. margin: 0 auto;
  52. }
  53. .content .content_top {
  54. width: 100%;
  55. border-bottom: 1px solid rgb(129, 222, 238);
  56. }
  57. .content .content_top ul li {
  58. width: 70px;
  59. height: 40px;
  60. line-height: 40px;
  61. text-align: center;
  62. display: inline-block;
  63. }
  64. .content .content_top .active {
  65. background-color: orange;
  66. }
  67. .content .content_bottom {
  68. margin-top: 40px;
  69. }
  70. .content .content_bottom dl {
  71. margin-left: 70px;
  72. float: left;
  73. }
  74. .content .content_bottom dl dd {
  75. margin: 10px 0;
  76. }
  77. .content .content_bottom img {
  78. width: 320px;
  79. height: 240px;
  80. }
  81. .content .content_bottom {
  82. display: none;
  83. }
  84. .content .squery {
  85. display: block;
  86. }
  87. p{
  88. margin: 20px 0;
  89. text-align: center;
  90. }
  91. </style>
  92. <script>
  93. $(function () {
  94. $(".nav>ul>li").hover(function () {
  95. $(this).children("ul").stop().slideDown();
  96. }, function () {
  97. $(this).children("ul").stop().slideUp();
  98. })
  99. $(".ul li").click(function () {
  100. $(this).addClass("active").siblings().removeClass("active");
  101. $(".content_bottom:eq(" + $(this).index() + ")").show().siblings(".content_bottom").hide();
  102. })
  103. $(".img").click(function () {
  104. $(this).css("background-image", "url('img/ly2.jpg')");
  105. })
  106. })
  107. </script>
  108. </head>
  109. <body>
  110. <div class="nav">
  111. <ul>
  112. <li>首页</li>
  113. <li>酒店
  114. <ul>
  115. <li>国外酒店</li>
  116. <li>国内酒店</li>
  117. <li>民宿客栈</li>
  118. </ul>
  119. </li>
  120. <li>旅游
  121. <ul>
  122. <li>跟团游</li>
  123. <li>周末游</li>
  124. <li>自由行</li>
  125. </ul>
  126. </li>
  127. <li>反馈</li>
  128. </ul>
  129. <div class="nav_right">
  130. <a href="">登录</a>
  131. <a href="">注册</a>
  132. </div>
  133. </div>
  134. <div class="img"></div>
  135. <div class="content">
  136. <div class="content_top">
  137. <ul class="ul">
  138. <li class="active">美国</li>
  139. <li>越南</li>
  140. <li>韩国</li>
  141. </ul>
  142. </div>
  143. <div class="content_bottom squery">
  144. <dl>
  145. <dt><img src="img/04.jpg" alt=""></dt>
  146. <dd>美国<天涯双飞5日游></dd>
  147. <dd>售价 12</dd>
  148. </dl>
  149. <dl>
  150. <dt><img src="img/05.jpg" alt=""></dt>
  151. <dd>美国<天涯双飞5日游></dd>
  152. <dd>售价 12</dd>
  153. </dl>
  154. </div>
  155. <div class="content_bottom">
  156. <dl>
  157. <dt><img src="img/06.jpg" alt=""></dt>
  158. <dd>越南<天涯双飞5日游></dd>
  159. <dd>售价 12</dd>
  160. </dl>
  161. <dl>
  162. <dt><img src="img/07.jpg" alt=""></dt>
  163. <dd>越南<天涯双飞5日游></dd>
  164. <dd>售价 12</dd>
  165. </dl>
  166. </div>
  167. <div class="content_bottom">
  168. <dl>
  169. <dt><img src="img/08.jpg" alt=""></dt>
  170. <dd>韩国<天涯双飞5日游></dd>
  171. <dd>售价 12</dd>
  172. </dl>
  173. <dl>
  174. <dt><img src="img/09.jpg" alt=""></dt>
  175. <dd>韩国<天涯双飞5日游></dd>
  176. <dd>售价 12</dd>
  177. </dl>
  178. </div>
  179. </div>
  180. <p>
  181. <a href="">关于我们</a>
  182. <a href="">常见问题</a>
  183. <a href="">反馈意见</a>
  184. <a href="">全站地图</a>
  185. <span>京ICP证03011373号</span>
  186. </p>
  187. </body>
  188. </html>

发表评论

表情:
评论列表 (有 0 条评论,17人围观)

还没有评论,来说两句吧...

相关阅读