imported>=海豚= |
imported>=海豚= |
(未显示同一用户的3个中间版本) |
第174行: |
第174行: |
| background-repeat: no-repeat; | | background-repeat: no-repeat; |
| background-size: 205px 240px; | | background-size: 205px 240px; |
| min-height: 248px; | | min-height: 250px; |
| padding: 0!important; | | padding: 0!important; |
| display: flex; | | display: flex; |
第225行: |
第225行: |
| } | | } |
| </style> | | </style> |
| <script>
| | </includeonly> |
| window.RLQ.push(function() {
| |
| window.RLQ = window.RLQ || [];
| |
| $(function() {
| |
| $(window).on('resize', function() {
| |
| $('.mainpage-banner-page').width($('.mainpage-banner').width());
| |
| }).resize();
| |
| var marginLeft = $('.mainpage').offset().left - $('.mainpage').parent().offset().left;
| |
| /* $('.mainpage').css('margin-left', marginLeft - (marginLeft - (($(window).width() - $('.mainpage').width()) / 2 - $('.mainpage').parent().offset().left)) / 2 + 'px'); // 计算合理的偏差,其中【($(window).width() - $('.mainpage').width()) / 2】用以计算主体居中时的实际offsetLeft值,减去父元素offset即是主体margin-left值,再用【marginLeft - (marginLeft - 主体margin-left值 / 2】来计算缓和后的margin-left值 */
| |
| var length = $('.mainpage-banner-page').length;
| |
| if (!length) return;
| |
| $('.mainpage-banner-container').width(length + '00%');
| |
| while (length--) $('.mainpage-banner-control').append('<span class="mainpage-banner-control-triggle"></span>');
| |
| var bannerCount = 25;
| |
| $('.mainpage-banner-control-triggle').on('click', function() {
| |
| bannerCount = 25;
| |
| $(this).addClass('on').siblings().removeClass('on');
| |
| var index = $(this).parent().children().index(this);
| |
| var target = $('.mainpage-banner-page').eq(index);
| |
| var left = target.prevAll().length || 0;
| |
| if (left) $('.mainpage-banner-container').css('margin-left', '-' + left + '00%');
| |
| else $('.mainpage-banner-container').css('margin-left', '0');
| |
| }).first().click();
| |
| setInterval(function() {
| |
| if (bannerCount-- > 0) return;
| |
| var next = $('.mainpage-banner-control-triggle.on').next();
| |
| if (!next.length) next = $('.mainpage-banner-control-triggle:first');
| |
| next.click();
| |
| }, 200);
| |
| });
| |
| });
| |
| </script><!--{/if}--></includeonly>
| |