---
title: "仿天猫图片展示效果2"
author: "keimon"
date: "2013-03-06T11:29:59Z"
tags: ["query"]
categories: ["Web前端"]
slug: "2"
draft: false
lastmod: "2013-03-06T11:29:59Z"
id: 1823709
url: "https://keimon.iteye.com/blog/1823709"
---

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)"&gt;  
&lt;html xmlns="[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)"&gt;  
&lt;head&gt;  
&lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312" /&gt;  
&lt;title&gt;无标题文档&lt;/title&gt;  
&lt;script type="text/javascript" src="jquery-1.8.3.js"&gt;&lt;/script&gt;  
&lt;style&gt;  
\*{  
  margin:0;  
  padding:0;  
}  
li{  
  list-style:none;  
}  
a{  
  text-decoration:none;  
  color:#000;  
}  
.twoD{  
  width:200px;  
  height:320px;  
  border:1px solid #000;  
  margin-left:100px;  
  overflow:hidden;  
  padding-top:5px;  
  padding-bottom:5px;  
  position:relative; /\*解决ie6,7对overflow：hidden的处理\*/  
}  
.imgS, .imgX{  
  width:500px;  
  height:150px;  
  position:relative;  
}  
.imgX{  
  border-top:1px dotted #ccc;  
}  
.imgSZ{  
  padding-top:30px;  
  padding-left:20px;  
}  
.imgSZ li{  
  padding-top:5px;  
}  
.imgSY{  
  position:absolute;  
  left:120px;  
  top:0;  
}  
.productIntro{  
  display:inline-block;  
  vertical-align:top;  
  padding-top:50px;  
  padding-left:10px;  
}  
.inline{\*display:inline;}  /\*解决ie6,7不识别display：inline-block\*/  
.imgSY img{  
  background-color:#999;  
  width:150px;  
  height:150px;  
}  
&lt;/style&gt;  
&lt;/head&gt;

&lt;body&gt;  
&lt;div class="twoD"&gt;  
  &lt;div class="imgS"&gt;  
     &lt;div class="imgSZ"&gt;  
     &lt;h3&gt;标题&lt;/h3&gt;  
  &lt;ul&gt;  
     &lt;li&gt;&lt;a href="#"&gt;内容1&lt;/a&gt;&lt;/li&gt;  
     &lt;li&gt;&lt;a href="#"&gt;内容2&lt;/a&gt;&lt;/li&gt;  
     &lt;li&gt;&lt;a href="#"&gt;内容3&lt;/a&gt;&lt;/li&gt;  
  &lt;/ul&gt;  
  &lt;/div&gt;  
  &lt;div class="imgSY"&gt;  
     &lt;img src="img5.jpg" /&gt;  
  &lt;div class="productIntro inline"&gt;  
     &lt;h3&gt;产品名称&lt;/h3&gt;  
     &lt;p&gt;产品描述&lt;/p&gt;  
  &lt;/div&gt;  
  &lt;/div&gt;  
  &lt;/div&gt;  
  &lt;div class="imgX"&gt;  
     &lt;div class="imgSZ"&gt;  
     &lt;h3&gt;标题&lt;/h3&gt;  
  &lt;ul&gt;  
     &lt;li&gt;&lt;a href="#"&gt;内容1&lt;/a&gt;&lt;/li&gt;  
     &lt;li&gt;&lt;a href="#"&gt;内容2&lt;/a&gt;&lt;/li&gt;  
     &lt;li&gt;&lt;a href="#"&gt;内容3&lt;/a&gt;&lt;/li&gt;  
  &lt;/ul&gt;  
  &lt;/div&gt;  
  &lt;div class="imgSY"&gt;  
     &lt;img src="img5.jpg" /&gt;  
  &lt;div class="productIntro inline"&gt;  
     &lt;h3&gt;产品名称&lt;/h3&gt;  
     &lt;p&gt;产品描述&lt;/p&gt;  
  &lt;/div&gt;  
  &lt;/div&gt;  
  &lt;/div&gt;  
&lt;/div&gt;

&lt;script type="text/javascript"&gt;  
/*  
\* 仿天猫图片展示效果2  
\* ie6,7,8，ff，opera中测试可用，其他浏览器未测；  
\*\*\*\*\*\*\*\*made by keimon \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\**  
\*\*\*\*\*\*\*\*\*\*\*2013-03-06\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\**  
\*/  
$(function(){  
  $('.imgSY').hover(function(){  
     $(this).stop().animate({'left':'-30px'},'slow');  
  },function(){  
     $(this).stop().animate({'left':'120px'},'slow');  
  })  
})  
&lt;/script&gt;

&lt;/body&gt;  
&lt;/html&gt;