滑动滚轮到某位置,导航字的下方红色杠杠不跟随红色文字,要怎么改?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | <!DOCTYPE html> < html lang = "en" > < head > < meta charset = "UTF-8" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < title >JS实战</ title > < link rel = "stylesheet" type = "text/css" href = "./css/index.css" /> < link rel = "stylesheet" type = "text/css" href = "./css/base.css" /> < link rel = "stylesheet" type = "text/css" href = "./css/animate.css" /> </ head > < body > <!-- 头部 --> < header class = "header" > < div class = "header__logo" >H5实战页面</ div > < div class = "header__nava" > <!-- 导航项 --> < a href = "javascript:;" class = "header__nava-item " >实战课程</ a > < a href = "javascript:;" class = "header__nava-item" >商业案例</ a > < a href = "javascript:;" class = "header__nava-item" >课程体系</ a > < a href = "javascript:;" class = "header__nava-item" >集成环境</ a > < a href = "javascript:;" class = "header__nava-item" >云端学习</ a > <!-- 导航项按钮 --> < a href = "javascript:;" class = "header__nava-item_custom_buttom" >即刻学习</ a > < div class = "header__nav-tip" ></ div > </ div > </ header > <!-- 屏幕1 --> < div class = "screen1" > <!-- 屏幕1标题1 --> < h2 class = "screen1__heading screen1__heading_animate_init" >实战课程重磅上线</ h2 > <!-- 屏幕2标题2 --> < h4 class = "screen1__subheading screen1__subheading_animate_init" >一键云学习,还在等什么?</ h4 > </ div > <!-- 屏幕2 --> < div class = "screen2" > <!-- 网页内容容器 --> < div class = "screen__wrap" > <!-- 屏幕2标题1 --> < h2 class = "screen2__wrap__heading screen2__wrap__heading_animate_init" >每门课都是真实商业案例</ h2 > < div class = "screen2__wrap__heading__line screen2__wrap__heading__line_animate_init" ></ div > <!-- 屏幕2标题2 --> < h5 class = "screen2__wrap__subheading screen2__wrap__subheading_animate_init" >真实案例,真实场景,在实战中实践、操作调试< br >大牛带你体验BAT真实开发流程,所有开发过程一一为你呈现</ h5 > <!-- 屏幕2图片项 --> < div class = "screen2__warp_img-item" > < div class = "screen2__wrap__img-item__bg-1" ></ div > < div class = "screen2__wrap__img-item__bg-2 screen2__wrap__img-item__bg-2_animate_init" ></ div > < div class = "screen2__wrap__img-item__bg-3 screen2__wrap__img-item__bg-3_animate_init" ></ div > </ div > </ div > </ div > <!-- 屏幕3 --> < div class = "screen3" > <!-- 容器 --> < div class = "screen__wrap" > <!-- 屏幕3图片 --> < div class = "screen3__img__bg-1" ></ div > <!-- 屏幕3标题1 --> < h2 class = "screen3__heding" >强大的语言课程体系支持</ h2 > < div class = "screen3__heading__line" ></ div > <!-- 屏幕3标题2 --> < h3 class = "screen3__subheding" >学习环境与课程轻松对接,安装、调试、写入、部署、运行,一站式解决< br >,让你体验开发流程</ h3 > < div class = "screen3__inner" > < div class = "screen3__inner-1" >HTML5</ div > < div class = "screen3__inner-2" >PHP</ div > < div class = "screen3__inner-3" >JAVA</ div > < div class = "screen3__inner-4" >Python</ div > < div class = "screen3__inner-5" >Node.JS</ div > </ div > </ div > </ div > <!-- 屏幕4 --> < div class = "screen4" > < div class = "screen__wrap" > < h2 class = "screen4__wrap__heading" >省去本地复杂的环境搭建</ h2 > < div class = "screen4__wrap__heading__line" ></ div > < h3 class = "screen4__wrap__subheading" >你可以告别在虚拟机中调试开发了</ h3 > < div class = "screen4__wrap__img" > < div class = "screen4__wrap__img__bg-1" ></ div > < div class = "screen4__wrap__img__bg-2" ></ div > < div class = "screen4__wrap__img__bg-3" ></ div > < div class = "screen4__wrap__img__bg-4" ></ div > < h4 class = "screen4__wrap__img__bg-1__inner-1" >实战课程集成开发环境</ h4 > < h4 class = "screen4__wrap__img__bg-2__inner-2" >内置终端命令行</ h4 > < h4 class = "screen4__wrap__img__bg-3__inner-3" >编译你的应用程序</ h4 > < h4 class = "screen4__wrap__img__bg-4__inner-4" >通过云端服务输出效果</ h4 > </ div > </ div > </ div > <!-- 屏幕5 --> < div class = "screen5" > < div class = "screen__wrap" > < div class = "screen5__wrap__img__bg-1" ></ div > < h2 class = "screen5__wrap__heading" >云端学习可以这样简单</ h2 > < div class = "screen5__wrap__heading__line" ></ div > < h3 class = "screen5__wrap__subheading" >看视频,敲代码一气呵成。结合慕课网为你提供的云端学习工具,所见即所得。从此学习不一样</ h3 > </ div > </ div > <!-- 屏幕6 --> < div class = "screen6" > < a href = "javascript:;" class = "screen6__bottom" >继续了解学习体验</ a > </ div > </ div > <!-- 页脚 --> < footer > < div class = "screen__wrap" > < div class = "footer__heading" > < a href = "javascript:;" >首页网站</ a > < a href = "javascript:;" >人才招聘</ a > < a href = "javascript:;" >联系我们</ a > < a href = "javascript:;" >高校联盟</ a > < a href = "javascript:;" >关于我们</ a > < a href = "javascript:;" >讲师招募</ a > < a href = "javascript:;" >意见反馈</ a > < a href = "javascript:;" >友情链接</ a > </ div > < div class = "footer__subheading" > < p >copyright ©2015 imooc.com All Rights Reserved | 京ICP备 13046642号-2</ p > </ div > </ div > </ footer > < div class = "outline" > < a href = "javascript:;" class = "outline__item" >实</ a > < a href = "javascript:;" class = "outline__item" >商</ a > < a href = "javascript:;" class = "outline__item" >课</ a > < a href = "javascript:;" class = "outline__item" >集</ a > < a href = "javascript:;" class = "outline__item" >云</ a > </ div > < script src = "./JS/index.js" ></ script > </ body > </ html > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | /* 头部 */ .header{ position : relative ; height : 60px ; width : 100% ; position : fixed ; top : 0 ; left : 0 ; z-index : 999 ; } /* 头部logo */ .header__logo{ height : 40px ; background-color :rgba( 128 , 128 , 128 , 0.1 ); font-size : 18px ; background : url (../img/logo.png) no-repeat ; font-weight : bold ; color : white ; z-index : 99 ; text-indent : 60px ; line-height : 40px ; float : left ; margin-left : 10px ; margin-top : 10px ; } /* 网页内容容器 */ .screen__wrap{ width : 1200px ; height : 640px ; margin : 0 auto ; } /* 头部导航 */ .header__nava{ position : absolute ; right : 30px ; display : block ; line-height : 60px ; height : 60px ; } /* 头部导航项 */ .header__nava-item{ color : #ffffff ; margin-right : 40px ; cursor : pointer ; width : 48px ; height : 12px ; position : relative ; } /* 头部导航按钮 */ .header__nava-item_custom_buttom{ border-radius: 5px ; height : 40px ; width : 96px ; background-color : #f01400 ; color : #efefff ; display : block ; float : right ; margin-top : 10px ; line-height : 40px ; margin-right : 30px ; text-align : center ; } .header__nava-item_custom_buttom:hover{ background-color : rgb ( 184 , 23 , 23 ); } /* 屏幕1 */ .screen 1 { height : 640px ; width : 100% ; background : url (../img/sc 1 .jpg) no-repeat ; background- size : cover; display : block ; position : relative ; } /* 屏幕1标题1 */ .screen 1 __heading{ position : absolute ; font-size : 40px ; font-weight : bold ; color : #ffff ; display : block ; padding-top : 240px ; text-align : center ; float : left ; width : 100% ; } /* 屏幕1标题2 */ .screen 1 __subheading{ position : absolute ; color : #ffff ; display : block ; padding-top : 315px ; text-align : center ; float : left ; width : 100% ; } /* 屏幕2 */ .screen 2 { width : 100% ; height : 640px ; height : 640px ; width : 100% ; background- size : cover; display : block ; position : relative ; overflow : hidden ; } /* 屏幕2标题1 */ .screen 2 __wrap__heading{ color : #07111b ; font-size : 40px ; text-align : center ; margin : 0 ; line-height : 40px ; padding-top : 90px ; } .screen 2 __wrap__heading__line{ border-bottom : #ff0000 2px solid ; width : 50px ; text-align : center ; margin-top : 30px ; margin : auto ; margin-top : 37px ; } /* 屏幕2标题2 */ .screen 2 __wrap__subheading{ line-height : 16px ; color : #07111b ; font-size : 16px ; text-align : center ; margin : 0 ; line-height : 28px ; padding-top : 24px ; } /* 屏幕2 图片项 */ .screen 2 __warp__img-item{ width : 100% ; height : 391px ; display : block ; float : left ; overflow : hidden ; margin : 0 auto ; } /* 屏幕2 图片项1 */ .screen 2 __wrap__img-item__bg -1 { display : block ; position : absolute ; float : left ; background : url (../img/sc 2 .png) no-repeat ; height : 361px ; width : 750px ; z-index : 1 ; color : red ; margin-left : 225px ; margin-top : 35px ; } /* 屏幕2 图片项2 */ .screen 2 __wrap__img-item__bg -2 { display : block ; position : absolute ; float : left ; background : url (../img/sc 2 -1 .png) no-repeat ; height : 380px ; width : 275px ; z-index : 99 ; margin-left : 462.5px ; margin-top : 20px ; } /* 屏幕2 图片项3 */ .screen 2 __wrap__img-item__bg -3 { display : block ; position : absolute ; float : left ; background : url (../img/sc 2 -2 .png) no-repeat ; height : 305px ; width : 266px ; margin-left : 580px ; margin-top : 103px ; z-index : 3 ; } /* 屏幕3 */ .screen 3 { float : left ; width : 100% ; height : 640px ; height : 640px ; width : 100% ; background- size : cover; display : block ; background-color : #2b333b ; overflow : hidden ; } /* 屏幕3图片 */ .screen 3 __img__bg -1 { display : block ; float : left ; background : url (../img/sc 3 .png) no-repeat ; height : 340px ; width : 308px ; margin-left : -80px ; margin-top : 150px ; z-index : 1 ; } /* 屏幕3标题1 */ .screen 3 __heding{ font-size : 35px ; color : #ffff ; padding-left : 665px ; padding-top : 230px ; } .screen 3 __heading__line{ border-bottom : #ff0000 2px solid ; width : 50px ; margin-left : 665px ; margin-top : 30px ; } /* 屏幕3标题2 */ .screen 3 __subheding{ font-size : 15px ; color : #ffff ; margin-left : 665px ; line-height : 25px ; padding-top : 20px ; } .screen 3 __inner{ margin-left : 677px ; display : block ; } .screen 3 __inner -1 { float : left ; width : 65px ; height : 65px ; border : #1f5975 4px solid ; border-radius: 50% ; color : #2294ff ; text-align : center ; line-height : 65px ; margin-top : 140px ; margin-right : 35px ; } .screen 3 __inner -2 { float : left ; width : 65px ; height : 65px ; border : #424d76 4px solid ; border-radius: 50% ; color : #7888fd ; text-align : center ; line-height : 65px ; margin-top : 140px ; margin-right : 35px ; } .screen 3 __inner -3 { float : left ; width : 65px ; height : 65px ; border : #6b4146 4px solid ; border-radius: 50% ; color : #dd413b ; text-align : center ; line-height : 65px ; margin-top : 140px ; margin-right : 35px ; } .screen 3 __inner -4 { float : left ; width : 65px ; height : 65px ; border : #29535f 4px solid ; border-radius: 50% ; color : #27bde5 ; text-align : center ; line-height : 65px ; margin-top : 140px ; margin-right : 35px ; } .screen 3 __inner -5 { float : left ; width : 65px ; height : 65px ; border : #3e4e40 4px solid ; border-radius: 50% ; color : #909e41 ; text-align : center ; line-height : 65px ; margin-top : 140px ; } /* 屏幕4 */ .screen 4 { float : left ; width : 100% ; height : 640px ; height : 640px ; width : 100% ; background- size : cover; display : block ; position : relative ; background-color : #f3f5f7 ; overflow : hidden ; } .screen 4 __wrap__heading{ color : #07111b ; font-size : 40px ; text-align : center ; padding-top : 90px ; } .screen 4 __wrap__heading__line{ border-bottom : #ff0000 4px solid ; width : 50px ; padding-top : 37px ; text-align : center ; margin : 0 auto ; } .screen 4 __wrap__subheading{ color : #07111b ; font-size : 16px ; text-align : center ; padding-top : 63px ; } .screen 4 __wrap__img{ display : block ; height : 100% ; width : 100% ; margin : 0 auto ; } .screen 4 __wrap__img__bg -1 { background : url (../img/sc 4 -1 .png) no-repeat ; margin-top : 80px ; margin-left : 100px ; margin-right : 220px ; width : 80px ; height : 70px ; display : block ; float : left ; } .screen 4 __wrap__img__bg -2 { background : url (../img/sc 4 -2 .png) no-repeat ; margin-right : 220px ; margin-top : 80px ; width : 80px ; height : 75px ; display : block ; float : left ; } .screen 4 __wrap__img__bg -3 { background : url (../img/sc 4 -3 .png) no-repeat ; margin-right : 220px ; margin-top : 80px ; width : 80px ; height : 75px ; display : block ; float : left ; } .screen 4 __wrap__img__bg -4 { background : url (../img/sc 4 -4 .png) no-repeat ; margin-top : 80px ; width : 80px ; height : 80px ; display : block ; float : left ; } .screen 4 __wrap__img__bg -1 __inner -1 { height : 16px ; margin-top : 30px ; padding-left : 60px ; font-size : 16px ; line-height : 16px ; float : left ; color : #07111b ; } .screen 4 __wrap__img__bg -2 __inner -2 { height : 16px ; margin-top : 30px ; padding-left : 160px ; font-size : 16px ; line-height : 16px ; float : left ; color : #07111b ; } .screen 4 __wrap__img__bg -3 __inner -3 { height : 16px ; margin-top : 30px ; padding-left : 180px ; font-size : 16px ; line-height : 16px ; float : left ; color : #07111b ; } .screen 4 __wrap__img__bg -4 __inner -4 { height : 16px ; margin-top : 30px ; padding-left : 160px ; font-size : 16px ; line-height : 16px ; float : left ; color : #07111b ; } /* 屏幕5 */ .screen 5 { position : absolute ; float : left ; width : 100% ; height : 640px ; height : 640px ; width : 100% ; display : block ; position : relative ; background : url (../img/sc 5 .jpg) no-repeat ; background- size : cover; overflow : hidden ; } .screen 5 __wrap__img__bg -1 { background : url (../img/sc 5 -1 .png) no-repeat ; width : 200px ; height : 200px ; margin-left : 496px ; margin-top : 100px ; } .screen 5 __wrap__heading{ color : #ffffff ; font-size : 40px ; text-align : center ; padding-top : 90px ; } .screen 5 __wrap__heading__line{ border-bottom : #ffffff 4px solid ; width : 50px ; padding-top : 30px ; text-align : center ; margin : 0 auto ; } .screen 5 __wrap__subheading{ color : #ffffff ; font-size : 16px ; text-align : center ; padding-top : 30px ; } .screen 6 __bottom{ width : 240px ; height : 60px ; border : #707070 1px solid ; border-radius: 5px ; margin : 0 auto ; margin-top : 70px ; text-align : center ; line-height : 60px ; font-weight : bold ; color : #14191e ; display : block ; } .screen 6 __bottom:hover{ color : #ff0000 ; } /* 屏幕6 */ .screen 6 { position : absolute ; float : left ; width : 100% ; height : 200px ; width : 100% ; background- size : cover; display : block ; position : relative ; background-color : #ffff ; overflow : hidden ; } /* 页脚 */ footer{ float : left ; height : 105px ; width : 100% ; background-color : #000000 ; overflow : hidden ; position : relative ; overflow : hidden ; } footer a{ margin-right : 40px ; color : #ffffff ; } .footer__heading{ margin-top : 33px ; width : 100% ; height : 15px ; text-align : center ; } .footer__subheading{ padding-top : 13px ; height : 20px ; margin : 0 auto ; text-align : center ; } .footer__subheading p{ font-size : 12px ; color : #ffffff ; text-align : center ; } .outline{ position : fixed ; bottom : 120px ; right : 0 ; box-shadow: 0px 4px 12px 0px rgba( 7 , 17 , 27 , 0.1 ); border-radius: 5px ; } .outline__item{ display : block ; width : 40px ; height : 30px ; color : #93999f ; text-align : center ; line-height : 30px ; border-top : 1px solid #eee ; background-color : #ffffff ; } .outline__item:first-child{ border : none ; border-radius: 5px 0 0 0 ; } .outline__item:last-child{ border-radius: 0 0 0 5px ; } .outline__item:hover,.outline__item__ative{ color : #ff0000 ; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | /* 屏幕1动画 */ .header_status_bgcolor{ background-color :rgba( 49 , 54 , 58 , 0.7 ); transition: all 2 s; } .header__nava-item:hover{ color : #ff0000 ; } /* 导航条inner激活 */ .header__nava-item_custom_ative{ margin-top : 14px ; padding-bottom : 14px ; color : #ff0000 ; } .header__nav-tip{ position : absolute ; width : 48px ; height : 2px ; background-color : #ff0000 ; left : 0px ; bottom : 7px ; transition: all 1 s; } .screen 1 __heading{ transition: all . 8 s; } .screen 1 __subheading{ transition: all 1.1 s; } .screen 1 __heading_animate_init, .screen 1 __subheading_animate_init{ transform: translate( 0 , 100% ); opacity: 0 ; } .screen 1 __heading_animate_done, .screen 1 __subheading_animate_done{ transform: translate( 0 , 0 ); opacity: 1 ; } /* 屏幕2动画 */ .screen 2 __wrap__img-item__bg -3 { transition: all 1 s . 6 s; } .screen 2 __wrap__heading__line{ transition: all 1 s . 5 s; } .screen 2 __wrap__heading, .screen 2 __wrap__subheading, .screen 2 __wrap__img-item__bg -2 { transition: all 1 s; } .screen 2 __wrap__heading_animate_init, .screen 2 __wrap__heading__line_animate_init, .screen 2 __wrap__subheading_animate_init, .screen 2 __wrap__img-item__bg -2 _animate_init{ transform: translate( 0 , 100% ); opacity: 0 ; } .screen 2 __wrap__img-item__bg -3 _animate_init{ transform: translate( -100% , 100% ); opacity: 0 ; } .screen 2 __wrap__heading_animate_done, .screen 2 __wrap__heading__line_animate_done, .screen 2 __wrap__subheading_animate_done, .screen 2 __wrap__img-item__bg -2 _animate_done, .screen 2 __wrap__img-item__bg -3 _animate_done{ transform: translate( 0 , 0 ); opacity: 1 ; } /* 屏幕3动画 */ .screen 3 __img__bg -1 { transition: all . 9 s ; } .screen 3 __heding{ transition: all . 7 s; } .screen 3 __inner{ transition: all . 4 s . 3 s ease-in; } .screen 3 __subheding{ transition: all . 7 s . 2 s; } .screen 3 __heading__line{ transition: all 1 s . 2 s; } .screen 3 __img__bg -1 _animate_init{ transform: translate( 0 , 40% ) scale( 0.2 ); opacity: 0 ; } .screen 3 __heding_animate_init, .screen 3 __heading__line_animate_init{ transform: translate( 0 , 40% ); opacity: 0 ; } .screen 3 __inner_animate_init{ transform: translate( 0 , 100px ); opacity: 0 ; } .screen 3 __subheding_animate_init{ transform: translate( 0 , 100% ); opacity: 0 ; } .screen 3 __img__bg -1 _animate_done{ transform: translate( 0 , 0 ) scale( 1.7 ); opacity: 1 ; } .screen 3 __heding_animate_done, .screen 3 __heading__line_animate_done, .screen 3 __subheding_animate_done, .screen 3 __inner_animate_done{ transform: translate( 0 , 0 ); opacity: 1 ; } /* 屏幕3弹跳效果 */ /* .screen3__inner{ } .screen3__inner_animate_init{ transform: translate(0,100px); opacity: 0; } .screen3__inner_animate_done{ animation: org 1s .5s; } @keyframes org{ 0%,60%,75%,90%,100%{ -webkit-transition-timing-function: ; } } */ /* 屏幕4动画 */ .screen 4 __wrap__heading{ transition: all 1 s; } .screen 4 __wrap__subheading, .screen 4 __wrap__heading__line{ transition: all 1 s . 1 s; } .screen 4 __wrap__heading_animate_init, .screen 4 __wrap__subheading_animate_init, .screen 4 __wrap__heading__line_animate_init{ transform: translate( 0 , 100px ); opacity: 0 ; } .screen 4 __wrap__heading_animate_done, .screen 4 __wrap__subheading_animate_done, .screen 4 __wrap__heading__line_animate_done{ transform: translate( 0 , 0 ); opacity: 1 ; } .screen 4 __wrap__img__bg -1 , .screen 4 __wrap__img__bg -2 , .screen 4 __wrap__img__bg -3 , .screen 4 __wrap__img__bg -4 { transition: all 1 s; } .screen 4 __wrap__img__bg -1 _animate_init, .screen 4 __wrap__img__bg -2 _animate_init, .screen 4 __wrap__img__bg -3 _animate_init, .screen 4 __wrap__img__bg -4 _animate_init{ transform: scale( 0 ); opacity: 0 ; } .screen 4 __wrap__img__bg -1 _animate_done, .screen 4 __wrap__img__bg -2 _animate_done, .screen 4 __wrap__img__bg -3 _animate_done, .screen 4 __wrap__img__bg -4 _animate_done{ transform: scale( 1 ); opacity: 1 ; } .screen 4 __wrap__img__bg -1 __inner -1 , .screen 4 __wrap__img__bg -2 __inner -2 , .screen 4 __wrap__img__bg -3 __inner -3 , .screen 4 __wrap__img__bg -4 __inner -4 { transition: all 1.2 s . 3 s; } .screen 4 __wrap__img__bg -1 __inner -1 _animate_init, .screen 4 __wrap__img__bg -2 __inner -2 _animate_init, .screen 4 __wrap__img__bg -3 __inner -3 _animate_init, .screen 4 __wrap__img__bg -4 __inner -4 _animate_init{ transform: translate( 0 , 100% ); opacity: 0 ; } .screen 4 __wrap__img__bg -1 __inner -1 _animate_done, .screen 4 __wrap__img__bg -2 __inner -2 _animate_done, .screen 4 __wrap__img__bg -3 __inner -3 _animate_done, .screen 4 __wrap__img__bg -4 __inner -4 _animate_done{ transform: translate( 0 , 0 ); opacity: 1 ; } .screen 5 __wrap__img__bg -1 { transition: all 1 s ; } .screen 5 __wrap__heading{ transition: all 1.2 s; } .screen 5 __wrap__heading__line, .screen 5 __wrap__subheading{ transition: all 1.2 s . 3 s; } .screen 5 __wrap__heading_animate_init, .screen 5 __wrap__heading__line_animate_init, .screen 5 __wrap__subheading_animate_init{ transform: translate( 0 , 100% ); opacity: 0 ; } .screen 5 __wrap__heading_animate_done, .screen 5 __wrap__heading__line_animate_done, .screen 5 __wrap__subheading_animate_done{ transform: translate( 0 , 0 ); opacity: 1 ; } .screen 5 __wrap__img__bg -1 { transition: all . 7 s; } .screen 5 __wrap__img__bg -1 _animate_init{ transform: scale( 0 ); opacity: 0 ; } .screen 5 __wrap__img__bg -1 _animate_done{ transform: scale( 1 ); opacity: 1 ; } .outline{ transform: translate( 100% , 0 ); transition: all 1.5 s; opacity: 0 ; } .outline_status_done{ transform: translate( 0 , 0 ); opacity: 1 ; } /* 文字特效图片额外 */ .screen 4 __wrap__img__bg -1: hover{ transform: scale( 1.3 ); cursor : pointer ; } .screen 4 __wrap__img__bg -2: hover{ transform: scale( 1.3 ); cursor : pointer ; } .screen 4 __wrap__img__bg -3: hover{ transform: scale( 1.3 ); cursor : pointer ; } .screen 4 __wrap__img__bg -4: hover{ transform: scale( 1.3 ); cursor : pointer ; } |
1 2 3 4 5 6 7 8 9 10 11 12 | *{ margin : 0 ; padding : 0 ; font-size : 12px ; font-family : "Microsoft Yahei" ; } a{ text-decoration : none ; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | // 获取元素 var getElement = function (selector){ return document.querySelector(selector); } // 获取元素素组 var getAllElement = function (selector){ return document.querySelectorAll(selector); } // 获取元素样式 var getAttribute = function (element){ return element.getAttribute( 'class' ); } // 设置元素样式 var setAttribute = function (element,cls){ return element.setAttribute( 'class' ,cls); } // 添加元素样式 var addcls = function (element,cls){ var basecls=getAttribute(element); if (basecls.indexOf(cls)===-1){ setAttribute(element,basecls+ " " +cls); } return ; } // 删除元素样式 var delcls= function (element,cls){ var basecls=getAttribute(element); if (basecls.indexOf(cls)>-1){ setAttribute(element,basecls.split(cls).join( ' ' ).replace(/\s+/g, ' ' )); } return ; } var screenAnimateElements ={ '.screen1' :[ '.screen1__heading' , '.screen1__subheading' ], '.screen2' :[ '.screen2__wrap__heading' , '.screen2__wrap__heading__line' , '.screen2__wrap__subheading' , '.screen2__wrap__img-item__bg-2' , '.screen2__wrap__img-item__bg-3' ], '.screen3' :[ '.screen3__img__bg-1' , '.screen3__heding' , '.screen3__heading__line' , '.screen3__subheding' , '.screen3__inner' ], '.screen4' :[ '.screen4__wrap__heading' , '.screen4__wrap__heading__line' , '.screen4__wrap__subheading' , '.screen4__wrap__img__bg-1' , '.screen4__wrap__img__bg-2' , '.screen4__wrap__img__bg-3' , '.screen4__wrap__img__bg-4' , '.screen4__wrap__img__bg-1__inner-1' , '.screen4__wrap__img__bg-2__inner-2' , '.screen4__wrap__img__bg-3__inner-3' , '.screen4__wrap__img__bg-4__inner-4' ], '.screen5' :[ '.screen5__wrap__img__bg-1' , '.screen5__wrap__heading' , '.screen5__wrap__heading__line' , '.screen5__wrap__subheading' ] }; var setScreenAnimateInit = function (screencls){ var animateElements=screenAnimateElements[screencls]; //获取需要设置动画的元素组 for ( var i=0;i<animateElements.length;i++){ var element = document.querySelector(animateElements[i]); //获取需要设置动画的元素 var baseCls = element.getAttribute( 'class' ); //获取基础样式名称 element.setAttribute( 'class' ,baseCls + ' ' +animateElements[i].substr(1)+ '_animate_init' ); } } var playScreenAnimateDone = function (screencls){ var animateElements=screenAnimateElements[screencls]; //获取需要设置动画的元素组 for ( var i=0;i<animateElements.length;i++){ var element = document.querySelector(animateElements[i]); var baseCls = element.getAttribute( 'class' ); element.setAttribute( 'class' ,baseCls.replace( '_animate_init' , '_animate_done' )); } } var navaItems=getAllElement( '.header__nava-item' ); var outlineItems=getAllElement( '.outline__item' ); var switchNavaItemAtive= function (idx){ for ( var i=0;i<navaItems.length;i++){ delcls(navaItems[i], 'header__nava-item_custom_ative' ); } addcls(navaItems[idx], 'header__nava-item_custom_ative' ); for ( var i=0;i<navaItems.length;i++){ delcls(outlineItems[i], 'outline__item__ative' ); } addcls(outlineItems[idx], 'outline__item__ative' ); } window.onload= function (){ console.log( 'onload' ) for (k in screenAnimateElements){ setScreenAnimateInit(k); } } setTimeout( function (){playScreenAnimateDone( '.screen1' );},100); switchNavaItemAtive(0); window.onscroll= function (){ var top=document.body.scrollTop||document.documentElement.scrollTop; console.log(top); if (top>400){ addcls(getElement( '.outline' ), 'outline_status_done' ); } else { delcls(getElement( '.outline' ), 'outline_status_done' ); } if (top>500){ addcls(getElement( '.header' ), 'header_status_bgcolor' ); } else { delcls(getElement( '.header' ), 'header_status_bgcolor' ); } if (top>100){ playScreenAnimateDone( '.screen2' ); switchNavaItemAtive(1); } else { switchNavaItemAtive(0) } if (top>600){ playScreenAnimateDone( '.screen3' ); switchNavaItemAtive(2); } if (top>1201){ playScreenAnimateDone( '.screen4' ); switchNavaItemAtive(3); } if (top>1850){ playScreenAnimateDone( '.screen5' ); switchNavaItemAtive(4); } } var navtip=getElement( '.header__nav-tip' ) var setNavaJump= function (i,lib){ var item=lib[i]; item.onclick= function (){ document.body.scrollTop=i*600; document.documentElement.scrollTop=i*600; } } for ( var i=0;i<navaItems.length;i++){ setNavaJump(i,navaItems); } for ( var i=0;i<outlineItems.length;i++){ setNavaJump(i,outlineItems); } var setTip= function (lib,idx){ lib[idx].onmouseover= function (){ console.log(idx); navtip.style.left=(idx*91.7)+ 'px' } var ativeTip=0; lib[idx].onmouseout= function (){ console.log(idx); for ( var i=0;i<lib.length;i++){ if (getAttribute(lib[i]).indexOf( 'header__nava-item_custom_ative' )>-1){ ativeTip=i; break ; } } navtip.style.left=(ativeTip*91.7)+ 'px' ; } } for ( var i=0;i<navaItems.length;i++){ setTip(navaItems,i); } |
15
收起
正在回答
3回答
同学你好,对于你的问题解答如下:
如下所示,setTip(nanaItem, i)就是调用函数,里面的参数就是实参
如下,switchNavaItemAtive在调用的时候,传入的数字就是实参呀
同学试着理解下。
如果我的回答帮助到了你,欢迎采纳,祝学习愉快~
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧