图片切换的js

fangmengyan 2015-09-01 03:31:26

左右切换的按钮在图片上,百度找了好多都找不到。
...全文
160 1 打赏 收藏 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
走在四季 2015-09-01
  • 打赏
  • 举报
回复
看了下我们用的是jquery.Xslider.js这个,你自己查些资料吧。 附一些代码仅供参考。

$(document).ready(function(){
	$("#slider1").Xslider({
		// 默认配置
		affect: 'scrollx', //效果  有scrollx|scrolly|fade|none
		speed: 800, //动画速度
		space: 4000, //时间间隔
		auto: true, //自动滚动
		trigger: 'click', //触发事件 注意用mouseover代替hover
		conbox: '.conbox', //内容容器id或class
		ctag: 'div.tsxwone', //内容标签 默认为<a>
		switcher: '.switcher', //切换触发器id或class
		stag: 'a', //切换器标签 默认为a
		current:'cur', //当前切换器样式名称
		rand:false //是否随机指定默认幻灯图片
	});
});

<div id="slider1" class="zn15_sybigimg">
    	<div class="conbox">
        	<c:forEach items="${activitylist }" var="en">
        		<div class="tsxwone">
        			<c:if test="${en.hrefstring==null||en.hrefstring=='' }"><c:if test="${en.id=='4028863b4d92ea49014d9330de270000' }"><input type="button" value="Try It For Free Now!" onclick="window.location.href='${ctx}/login.jsp'" /></c:if><a href="${ctx }/activityinforcon!input.action?id=${en.id}" target="_blank" class="updatehotspot">
        			<img src="${ctx}${en.photoPath}" dir="hotspot_${en.id}" usemap="#hotspot_${en.id}"/>
        			<c:if test="${en.hotspot!=null&&en.hotspot!='' }">
        			${en.hotspot}
        			</c:if>
        			</a>
        			</c:if>
        			<c:if test="${en.hrefstring!=null&&en.hrefstring!='' }">
	        			<a href="${en.hrefstring}" ${fn:indexOf(en.hrefstring,'cltguides')==-1?'target="_blank"':'' } class="updatehotspot">
	        			    <img src="${ctx}${en.photoPath}" dir="hotspot_${en.id}" usemap="#hotspot_${en.id}"/>
		        			<c:if test="${en.hotspot!=null&&en.hotspot!='' }">
		        			${en.hotspot}
		        			</c:if>
	        			</a>
        			</c:if>
        		</div>
        	</c:forEach>
      	</div>
      	<div class="switcher">
      		<c:forEach items="${activitylist }" var="en" varStatus="i"><a href="javascript:void(0);" ${i.index==0?"class='cur'":"" }></a></c:forEach>
      	</div>
  	</div>
正好我也学习下~

87,984

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧