Commit dc3f0f4542435be0f02c22550bc8afc2503cba73

Authored by Andy
1 parent 4367376a

add 关于我们 荣誉轮播

contact.html
... ... @@ -53,12 +53,8 @@
53 53 </head>
54 54 <body>
55 55  
56   -<!-- Header Area -->
57   -<header id="header" class="header">
58   -
59   -</header>
60   -<!--/ End Header Area -->
61   -
  56 +<header id="header" class="header"></header>
  57 +<!--topbar 任你停-->
62 58 <div class="contactside-bg" >
63 59 <div class="container">
64 60 <div class="row">
... ... @@ -69,7 +65,7 @@
69 65 </div>
70 66 </div>
71 67 </div>
72   -
  68 +<!--经典案例-->
73 69 <section id="contact" class="section contact" >
74 70 <div class="container">
75 71 <p class="row">
... ... @@ -127,8 +123,28 @@
127 123 </div>
128 124 </div>
129 125 </section>
  126 +<!--荣誉轮播-->
  127 +<section class="section contact" style="padding-top: 60px;padding-bottom: 0px;">
  128 + <div class="container">
  129 + <div class="example-title text-center">服务资质</div>
  130 + <div class="example-subtitle text-center">打造创新型停车场 轻松停车</div>
  131 + <div class="box">
  132 + <dl id="roll">
  133 + <dd><img src="images/cups-1.png" /></dd>
  134 + <dd><img src="images/cups-2.png" /></dd>
  135 + <dd><img src="images/cups-3.png" /></dd>
  136 + <dd><img src="images/cups-4.png" /></dd>
  137 + <dd><img src="images/cups-5.png" /></dd>
  138 + <dd><img src="images/cups-6.png" /></dd>
  139 + <dd><img src="images/cups-7.png" /></dd>
  140 + <dd><img src="images/cups-8.png" /></dd>
  141 + </dl>
  142 + </div>
130 143  
131   -<section id="" class="section contact" style="padding-top: 0;padding-bottom: 0;">
  144 + </div>
  145 +</section>
  146 +<!--联系我们-->
  147 +<section class="section contact" style="padding-top: 0;padding-bottom: 0;">
132 148 <div class="container">
133 149 <div class="row rnt_pos_rel">
134 150 <div class="contact_msg_cont rnt_pos_abs">
... ...
css/contact.css
... ... @@ -180,4 +180,22 @@
180 180 font-weight:400;
181 181 color:rgba(0,0,0,1);
182 182 line-height:23px;
183   -}
184 183 \ No newline at end of file
  184 +}
  185 +
  186 +/* 荣誉 轮播*/
  187 +.box{
  188 + height: 260px;
  189 + overflow: hidden;
  190 + width: 1200px;
  191 + margin: 60px auto;
  192 + position: relative;
  193 +}
  194 +#roll{
  195 + width: 200%;
  196 +}
  197 +#roll dd{
  198 + width: 382px;
  199 + height: 260px;
  200 + float: left;
  201 + margin-right: 20px;
  202 +}
... ...
images/cups-1.png 0 → 100644

174 KB

images/cups-2.png 0 → 100644

162 KB

images/cups-3.png 0 → 100644

192 KB

images/cups-4.png 0 → 100644

173 KB

images/cups-5.png 0 → 100644

162 KB

images/cups-6.png 0 → 100644

135 KB

images/cups-7.png 0 → 100644

159 KB

images/cups-8.png 0 → 100644

161 KB

js/contact.js
... ... @@ -442,3 +442,198 @@ option = {
442 442  
443 443 // 使用刚指定的配置项和数据显示图表。
444 444 myChart.setOption(option);
  445 +
  446 +
  447 +/**
  448 +
  449 + * parallelRoll 左右无缝滚动
  450 +
  451 + * boxName : 最外层盒子类名
  452 +
  453 + * tagName : 滚动标签元素
  454 +
  455 + * time : 滚动间隔时间
  456 +
  457 + * direction : 滚动方向 right-->向右 left-->向左
  458 +
  459 + * visual : 可视数
  460 +
  461 + * prev : 上一张
  462 +
  463 + * next : 下一张
  464 +
  465 + * Date: 19-01-24
  466 +
  467 + * */
  468 +
  469 +(function($){
  470 +
  471 + $.fn.parallelRoll = function(options){
  472 +
  473 + var opts = $.extend({}, $.fn.parallelRoll.defaults, options);
  474 +
  475 + var _this = this;
  476 +
  477 + var l = _this.find(opts.tagName).length;
  478 +
  479 + var autoRollTimer;
  480 +
  481 + var flag = true; // 防止用户快速多次点击上下按钮
  482 +
  483 + var arr = new Array();
  484 +
  485 + /**
  486 +
  487 + * 如果当 (可视个数+滚动个数 >滚动元素个数) 时 为不出现空白停顿 将滚动元素再赋值一次
  488 +
  489 + * 同时赋值以后的滚动元素个数是之前的两倍 2 * l.
  490 +
  491 + * */
  492 +
  493 + if(opts.amount + opts.visual > l){
  494 +
  495 + _this[0].innerHTML += _this[0].innerHTML;
  496 +
  497 + l = 2 * l;
  498 +
  499 + }else{
  500 +
  501 + l = l;
  502 +
  503 + }
  504 +
  505 + var w = $(opts.tagName).outerWidth(true); //计算元素的宽度 包括补白+边框
  506 +
  507 + _this.css({width: (l * w) + 'px'}); // 设置滚动层盒子的宽度
  508 +
  509 + return this.each(function(){
  510 +
  511 + _this.closest('.'+opts.boxName).hover(function(){
  512 +
  513 + clearInterval(autoRollTimer);
  514 +
  515 + },function(){
  516 +
  517 + switch (opts.direction){
  518 +
  519 + case 'left':
  520 +
  521 + autoRollTimer = setInterval(function(){
  522 +
  523 + left();
  524 +
  525 + },opts.time);
  526 +
  527 + break;
  528 +
  529 + case 'right':
  530 +
  531 + autoRollTimer = setInterval(function(){
  532 +
  533 + right();
  534 +
  535 + },opts.time);
  536 +
  537 + break;
  538 +
  539 + default :
  540 +
  541 + alert('参数错误!');
  542 +
  543 + break;
  544 +
  545 + }
  546 +
  547 + }).trigger('mouseleave');
  548 +
  549 + $('.'+opts.prev).on('click',function(){
  550 +
  551 + flag ? left() : "";
  552 +
  553 + });
  554 +
  555 + $('.'+opts.next).on('click',function(){
  556 +
  557 + flag ? right() : "";
  558 +
  559 + });
  560 +
  561 + });
  562 +
  563 + function left(){
  564 +
  565 + flag = false;
  566 +
  567 + _this.animate({marginLeft : -(w*opts.amount)},1000,function(){
  568 +
  569 + _this.find(opts.tagName).slice(0,opts.amount).appendTo(_this);
  570 +
  571 + _this.css({marginLeft:0});
  572 +
  573 + flag = true;
  574 +
  575 + });
  576 +
  577 + };
  578 +
  579 + function right(){
  580 +
  581 + flag = false;
  582 +
  583 + arr = _this.find(opts.tagName).slice(-opts.amount);
  584 +
  585 + for(var i = 0; i<opts.amount; i++){
  586 +
  587 + $(arr[i]).css({marginLeft : -w*(i+1)}).prependTo(_this);
  588 +
  589 + }
  590 +
  591 + _this.animate({marginLeft : w*opts.amount},1000,function(){
  592 +
  593 + _this.find(opts.tagName).removeAttr('style');
  594 +
  595 + _this.css({marginLeft:0});
  596 +
  597 + flag = true;
  598 +
  599 + });
  600 +
  601 + };
  602 +
  603 + };
  604 +
  605 + //插件默认选项
  606 +
  607 + $.fn.parallelRoll.defaults = {
  608 +
  609 + boxName : 'box',
  610 +
  611 + tagName : 'dd',
  612 +
  613 + time : 3000, //
  614 +
  615 + direction : 'left', // 滚动方向
  616 +
  617 + visual : 3 , //可视数
  618 +
  619 + prev : 'prev',
  620 +
  621 + next : 'next',
  622 +
  623 + amount : 1 // 滚动数 默认是1
  624 +
  625 + };
  626 +
  627 +})(jQuery);
  628 +
  629 +
  630 +
  631 +$(document).ready(function(){
  632 +
  633 + $("#roll").parallelRoll({
  634 +
  635 + amount : 1
  636 +
  637 + });
  638 +
  639 +});
... ...