相册浏览

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="_3_14.WebForm3" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        
        table{width:400px;border:solid 2px #128B0C;}
        #bigtd img{width:300px;height:360px;}
        #tr1{text-align: center;}
        #tr2 td img{width:70px;height:80px;}
        #btn1,#btn2{width:25px;height:80px;border-color: #18B610; color: #128B0C; font-size: 22px;}
    </style>
    <script src="Jquery1.7.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('img').click(function () {
                $('#bigimg').attr('src', this.src);
                //alert('ok');
            })
            var pictures = new Array('3.jpg', '4.jpg', '5.jpg', '6.jpg', 'b.jpg', 'r.jpg', 'y.jpg', 'p.jpg');
            var a = 0;
            var b = 1;
            var c = 2;
            var d = 3;
            $('#btn1').click(function () {
                if (a > 6) { a = -1; }
                a++;
                $('#p1').attr('src', 'images/' + pictures[a]);
                if (b > 6) { b = -1; }
                b++;
                $('#p2').attr('src', 'images/' + pictures[b]);
                if (c > 6) { c = -1; }
                c++;
                $('#p3').attr('src', 'images/' + pictures[c]);
                if (d > 6) { d = -1; }
                d++;
                $('#p4').attr('src', 'images/' + pictures[d]);
            })


            $('#btn2').click(function () {
                if (a < 1) { a = 8; }
                a--;
                $('#p1').attr('src', 'images/' + pictures[a]);
                if (b <1) { b = 8; }
                b--;
                $('#p2').attr('src', 'images/' + pictures[b]);
                if (c <1) { c =8; }
                c--;
                //alert(c);
                $('#p3').attr('src', 'images/' + pictures[c]);
                if (d <1) { d = 8; }
                d--;
                $('#p4').attr('src', 'images/' + pictures[d]);
            })
        })
    </script>


</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table class="style1">
            <tr id="tr1">
                <td colspan="6" id="bigtd">
                    <img alt="图片" src="images/3.jpg" id="bigimg"/></td>
            </tr>
            <tr id="tr2">
                <td>
                    <input id="btn1" type="button" value="◁"/></td>
                <td >
                    <img alt="图片" src="images/3.jpg" id='p1'/></td>
                <td >
                    <img alt="图片" src="images/4.jpg" id='p2'/></td>
                <td >
                    <img alt="图片" src="images/5.jpg" id='p3'/></td>
                <td >
                    <img alt="图片" src="images/6.jpg" id='p4'/></td>
                <td >
                    <input id="btn2" type="button" value="▷" /></td>
            </tr>
        </table>
    </div>
    </form>
    <p>
        &nbsp;</p>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值