您现在的位置是:网站首页> 编程资料编程资料

html5+css如何实现中间大两头小的轮播效果html5实现点击弹出图片功能html5 录制mp3音频支持采样率和比特率设置html5表单的required属性使用html5调用摄像头实例代码HTML5页面音频自动播放的实现方式Html5大屏数据可视化开发的实现html实现弹窗的实例HTML5来实现本地文件读取和写入的实现方法HTML 罗盘式时钟的实现HTML5简单实现添加背景音乐的几种方法

2023-10-12 327人已围观

简介 这篇文章主要介绍了html5+css如何实现中间大两头小的轮播效果的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

国际惯例,先上效果

好了,话不多说,上去就是一顿撸。

css:

html:

  • 1
  • 2
  • 3
  • 4
aaa
vvvv

js:

 $(function(){ $('.box>li:nth(1)').css({ width: '36%', margin: '0 2%' }) $('.box>li:nth(1)').append('视频主题') }) $(window).resize(function () { //当浏览器大小变化时 $('.box').css('height', 'auto') }) function moveLeft(){ var height = $('.box>li:nth(1)').height() $('.box').css('height', height) $('.box>li').css({ width: '20%', margin: '0 0%' }) $('.box>li:nth(2)').css({ width: '36%', margin: '0 2%' }) $('.box').animate({ left: '-25%' }, 400, function () { // 把第一个子元素移到最后,并且设置left=0 $(".box").append($('.box>li:nth(0)')[0]); $(".dd-2").append($('.aa')[0]); $(".aa").append('ccc'); $('.box').css('left', 0); $(".btn").attr("disabled", false); $('.box>li:nth(1)').append('视频主题') }); } function moveRight(){ $('.box>li').css({ width: '20%', margin: '0 0%' }) $('.box>li:nth(0)').css({ width: '36%', margin: '0 2%' }) var height = $('.box>li:nth(1)').height() $('.box').css('height', height) $(".box").prepend($('.box>li:nth(3)')[0]); $('.box').css('left', '-20%'); $('.box').animate({ left: 0 }, 400, function () { $(".btn").attr("disabled", false); $('.box>li:nth(1)').append('视频主题') }); }

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

-六神源码网