图片游览效果

 

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        #large{ width:400px; height:350px; border:1px solid red;  margin:60px 0px 0px 400px;}
        #large img{ width:400px; height:350px;}
        #little{ width:736px;height:100px; margin:20px 0px 0px 251px; }
        #left{ float:left; width:50px; height:100px;}
        #content{ float:left; width:625px; height:100%; margin:0px 4px 0px 4px; }
        #content img{ width:100px; height:90px; border:1px soild green; margin-left:4px;}
        #right{float:left; width:50px; height:100px;}                         
    </style>
    <script src="Jquery1.7.js" type="text/javascript"></script>
    <script  type="text/javascript">
        $(function () {
            var array = new Array('asd.jpg', 'fd.jpg', '12.jpg', 'we.jpg', 'saa.jpg', 'as4.jpg');
            //单机下面图片显示到大图片
            $('#content img').bind('click', function () {
                $('#content img').css({ width: '100px', height: '90px', border: '' });
                $(this).css({ border: '4px solid green', width: '92px', height: '82px' });
                var str = $(this).attr('src');
                $('#image').attr('src', str);
            })
            //next的运用来一下走三张图片  有bug           
            var count = 0;
            $('#next').bind('click', function () {
                $('#content img').css({ width: '100px', height: '90px', border: '' });
                if (count == 6) {
                alert('到头了!')
                    count = 0;
                }
                $('#img1').attr('src', $('#img4').attr('src'));
                $('#img2').attr('src', $('#img5').attr('src'));
                $('#img3').attr('src', $('#img6').attr('src'));
                $('#img4').attr('src', 'images/' + array[count]);
                count++;
                $('#img5').attr('src', 'images/' + array[count]);
                count++;
                $('#img6').attr('src', 'images/' + array[count]);
                count++;
            })
            $('#hou').click(function () {
                $('#content img').css({ width: '100px', height: '90px', border: '' });
                if (count == 6) {
                    alert('到头了!');
                    count = 0;

                }
                $('#img1').attr('src', $('#img4').attr('src'));
                $('#img2').attr('src', $('#img5').attr('src'));
                $('#img3').attr('src', $('#img6').attr('src'));
                $('#img4').attr('src', 'images/' + array[count]);
                count++;
                $('#img5').attr('src', 'images/' + array[count]);
                count++;
                $('#img6').attr('src', 'images/' + array[count]);
                count++;
            })
        })
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="large"><img id="image" src="images/asd.jpg" /></div>
    <div id="little">
    <div id="left"><input id="next" type="button" value="◄" style="height:90px; width:100%; font-family:@楷体; font-size:24px;" /></div>
    <div id="content">
    <img id="img1" src="images/asd.jpg"/><img id="img2" src="images/fd.jpg" /><img id="img3" src="images/12.jpg" /><img id="img4" src="images/we.jpg" /><img id="img5" src="images/saa.jpg" /><img id="img6" src="images/as4.jpg" /></div>
    <div id="right"><input id="hou" type="button" value="►" style="height:90px; width:100%; font-family:@楷体; font-size:24px;" /></div>
    </div>
    </form>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值