• 微信号:Zh-y9213
您当前的位置:爱资源分享网 > > 网站源码 > 网页特效

jQuery入职经历水平时间轴历程代码

栏目:网页特效时间:2021-08-11 17:55阅读数:46人阅读
一款带有左右箭头控制的jQuery入职经历水平时间轴历程代码,简单横向时间轴样式,鼠标悬停变色高亮显示。


js代码

<script type="text/javascript">
	
	$(function() {
		
		var timeLength = $('.time-box li').length,
			timeliWidth = $('.time-box li').outerWidth();
		
		var index = 0;
		
		$('.time-box ul').width(timeLength * timeliWidth);
		
		function slideOne(i) {
			var scrollVal = i * timeliWidth; //每次切换的数量
			$('.time-box').stop().animate({
				scrollLeft: scrollVal
			}, 300);
		}
		
		$('.right-btn').click(function() {
			index = index >= (timeLength-4) ? 0 : index + 1;
			slideOne(index);
		})
		
		$('.left-btn').click(function() {
			index = index <= 0 ? (timeLength-4) : index - 1;
			slideOne(index);
		})
		
	})
	
</script>


在线预览
资源均来自第三方,谨慎下载,前往第三方网站下载

本站所有文章、数据、图片均来自互联网,一切版权均归源网站或源作者所有。

如果侵犯了你的权益请来信告知我们删除。邮箱:737597453@qq.com