日期:2014-05-16 浏览次数:20410 次
<div id="smallpic"> <a href="javascript:viewPre()"><img src="images/left.gif" width="35" height="154" class="left" /></a> <ul id="jinxuan"> <li class="view"><a href="javascript:void(0)" onclick="javascript:viewbig('/bb/upfile/2012720115958.jpg')"><img src="/bb/upfile/2012720115958_f.jpg" /></a></li> <li class="view"><a href="javascript:void(0)" onclick="javascript:viewbig('/bb/upfile/2012720112159.jpg')"><img src="/bb/upfile/2012720112159_f.jpg" /></a></li> <li class="view"><a href="javascript:void(0)" onclick="javascript:viewbig('/bb/upfile/2012720114059.jpg')"><img src="/bb/upfile/2012720114059_f.jpg" /></a></li> <li class="hide"><a href="javascript:void(0)" onclick="javascript:viewbig('/bb/upfile/2012720115958.jpg')"><img src="/bb/upfile/2012720115958_f.jpg" /></a></li> <li class="hide"><a href="javascript:void(0)" onclick="javascript:viewbig('/bb/upfile/2012720112159.jpg')"><img src="/bb/upfile/2012720112159_f.jpg" /></a></li> <li class="hide"><a href="javascript:void(0)" onclick="javascript:viewbig('/bb/upfile/2012720114059.jpg')"><img src="/bb/upfile/2012720114059_f.jpg" /></a></li> </ul> <a href="javascript:viewNext()"><img src="images/right.gif" width="35" height="154" class="left" /></a> </div>
function viewPre() { if ($("#jinxuan li.view").prev(".hide").length > 0) { var views = $("#jinxuan li.view"); var view = views[views.length - 1]; var prevview = $(view).prev(".hide"); prevview.removeClass("hide"); prevview.addClass("view"); $(view).removeClass("view"); $(view).addClass("hide"); } } function viewNext() { if ($("#jinxuan li.view").next(".hide").length > 0) { var view = $("#jinxuan li.view")[0]; var nextview=$(view).next(".hide"); nextview.removeClass("hide"); nextview.addClass("view"); $(view).removeClass("view"); $(view).addClass("hide"); } } function viewbig(file) { $("#bcimg").attr("src",file); }
function viewPre() { var v = $("#jinxuan li.view"), h = v.eq(0).prev(); if (h.size() > 0) { h.attr('class', 'view'); v.filter(':last').attr('class', 'hide'); } } function viewNext() { var v = $(&quo