图片画廊

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="图片画廊.aspx.cs" Inherits="JQuery练习.图片画廊" %>


<!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>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <style type="text/css">
        #box /* 盒子样式 */
        {
            width: 500px;
            margin: 12px;
        }
        #largeImg /* 大图画框样式 */
        {
            border: solid 1px #aaa;
            width: 330px;
            height: 200px;
            padding: 2px;
        }
        .thumbs img /* 缩微图样式 */
        {
            border: solid 1px #aaa;
            width: 50px;
            height: 50px;
            padding: 4px;
        }
        p /* 段落样式 */
        {
            padding: 0;
            margin: 6px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="box">
        <h1>
            图片画廊</h1>
        <p>
            <img id="largeImg" src="images/1369517539.jpg" title="images/1369517539.jpg" /></p>
        <p class="thumbs">
            <a href="images/1369517539.jpg" title="images/1369517539.jpg"><img src="images/1369517539.jpg" /></a>
            <a href="images/1457599827.jpg" title="images/1457599827.jpg"><img src="images/1457599827.jpg" /></a> 
            <a href="images/2643707308.jpg" title="images/2643707308.jpg"><img src="images/2643707308.jpg" /></a> 
            <a href="images/2838324803.jpg" title="images/2838324803.jpg"><img src="images/2838324803.jpg" /></a> 
            <a href="images/4081012159.jpg" title="images/4081012159.jpg"><img src="images/4081012159.jpg" /></a>
        </p>
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    $(function () { //页面初始化激活函数
        $(".thumbs a").mouseover(function () {      //鼠标经过缩微图时的处理函数 
            var largePath = $(this).attr("href");   //获取缩微图的地址信息
            var largeTitle = $(this).attr("title"); //获取缩微图的提示信息
            $(this).children().css("border-color", "#F90"); //设置缩微图内超链接样式
            $("#largeImg").attr({ src: largePath, title: largeTitle }); //把缩微图的地址和提示信息赋予给大图
        });
        $(".thumbs a").mouseout(function () { // 鼠标移开缩微图时的处理函数
            $(this).children().css("border-color", "#aaa");  // 恢复缩微图内超链接的默认边框颜色
        });
    });
</script>


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值