<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="Index" %>
<!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 id="Head1" runat="server">
<title></title>
<script src="Js/Jquery1.7.js" type="text/javascript"></script>
<style type="text/css">
ul, li
{
list-style-type: none;
margin: 0px;
padding: 0px;
}
#menu li
{
text-align:center;
float: left;
padding: 5px;
margin-right: 2px;
width: 147px;
cursor: pointer;
}
#menu li.tabfocus
{
width: 111px;
font-weight: bold;
background-color: #eee;
z-index:100;
border: solid 1px #666;
position:relative;
top: 0px;
left: 0px;
}
#content{ width:714px;
height:140px;
padding:10px; background-color:#eee; position:relative; top:-1px; clear:left;
left: 0px;
border-bottom-style: none;
border-bottom-color: inherit;
border-bottom-width: 0;
}
#content li
{
display: none;
}
#content li.confocus
{
display: block;
}
</style>
<script type="text/javascript"> $(function () {
$('#menu li').each(function (index) {
$(this).mouseenter(function () {
$('#menu li.tabfocus').removeClass('tabfocus');
$(this).addClass('tabfocus');
$('#content li:eq(' + index + ')').show().siblings().hide();
})
})
$("img").click(function () {
// window.open();
// alert($(this).attr("src").toString().substring($(this).toString().lastIndexOf("/")));
window.location = "Find.aspx?id=" + $(this).attr("src").toString().substring($(this).toString().lastIndexOf("/"));
// alert($(this).attr("src"));
})
$(this).addClass('tabfocus');
})
</script>
</head>
<body>
<form id="form2" runat="server">
<ul id="menu">
<li class="tabfocus" style="font-weight: normal">疯狂抢购</li>
<li>热卖商品</li>
<li>热评商品</li>
<li>新品上架</li>
<li>猜你喜欢</li>
</ul>
<ul id="content">
<li class="conclass">
<img alt="" src="319/1_small.jpg" />
<img alt="" src="319/2_small.jpg" />
<img alt="" src="319/3_small.jpg" />
<img alt="" src="319/smallJiatingyingyuan.jpg" />
<img alt="" src="319/smallKongtiao.jpg" />
</li>
<li> <img alt="" src="319/smallGuo.jpg" />
<img alt="" src="319/smallHaixin.jpg" />
<img alt="" src="319/smallJiaNengXiangji.jpg" />
<img alt="" src="319/smallJiatingyingyuan.jpg" />
<img alt="" src="319/smallKongtiao.jpg" />
</li>
<li>二手的内容</li>
<li>
<img alt="" src="319/smallChangpian.jpg" />
<img alt="" src="319/smallFamo.jpg" />
<img alt="" src="319/smallFamo.jpg" />
<img alt="" src="319/smallFushiXiangji.jpg" />
<img alt="" src="319/smallGuntong.jpg" />
</li>
</ul>
<asp:Button ID="Button1" runat="server" οnclick="Button1_Click" Text="Button" />
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Find : System.Web.UI.Page
{
protected string imgname;
protected string imgbigname;
protected void Page_Load(object sender, EventArgs e)
{
imgname =Request["id"].ToString();//.Substring(Request["id"].ToString().LastIndexOf("/")+1);
//以面是小图片
//下面是大图片
imgbigname ="images/"+Request["id"].ToString().Substring(Request["id"].ToString().LastIndexOf("/") + 1);
// ClientScript.RegisterClientScriptBlock(GetType(),"as","<script>alert('"+imgname+"')</script>");
DataBind();
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Find.aspx.cs" Inherits="Find" %>
<!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>
<link href="cloud-zoom.css" rel="stylesheet" type="text/css" />
<script src="Js/Jquery1.7.js" type="text/javascript"></script>
<script src="Js/cloud-zoom.1.0.2.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<a href='<%# imgbigname %>' class = 'cloud-zoom' id='zoom1'
rel="adjustX: -100, adjustY:40">
<img src="<%#imgname %>" alt='' title="预览大图"
style="height: 310px; width: 264px" />
</a>
<%--<img src="<%#imgname %>" style="height: 310px; width: 269px" />--%>
</div>
</form>
</body>
</html>