鼠标经过隐藏图片显示文字
2013-12-05 11:12
651 查看
鼠标经过隐藏图片显示文字
演示
JavaScript Code<script>
$(document).ready(function() {
//if mouse over and mouse out
$('.eff').hover(
function () {
value = $(this).find('img').outerHeight() * -1;
//for left/right if you have different width and height,
//commented out because we are using up/down in this example
//value = $(this).find('img').outerWidth() * -1);
//animate the image
// you can change the sliding direction by changing bottom to left, right or top
// if you changed this, you will have to change the position of the hover out as well
$(this).find('img').stop().animate({bottom: value} ,{duration:500, easing: 'easeOutBounce'});
},
function () {
//reset the image
// the position property (bottom), it must be same with the on in the mouseover
$(this).find('img').stop().animate({bottom:0} ,{duration:500, easing: 'easeOutBounce'});
});
//if user clicked on the thumbnail
$('.eff').click(function () {
//grab and execute the first link in the thumbnail
window.location = $(this).find('a:first').attr('href');
});
});
</script>
XML/HTML Code<div class="eff">
<img src="1.gif" alt="Test 1" title="" width="126" height="126" />
<div class="caption"><a href="http://www.freejs.net" class="header">www.freejs.net</a></div>
</div>
<div class="eff">
<img src="2.gif" alt="Test 1" title="" width="126" height="126" />
<div class="caption"><a href="http://www.freejs.net" class="header">Umbrella</a><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p></div>
</div>
<div class="eff">
<img src="3.gif" alt="Test 1" title="" width="126" height="126" />
<div class="caption"><a href="http://www.freejs.net" class="header">Maximum</a><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p></div>
</div>
<div class="clear"></div>
原文地址:http://www.freejs.net/article_jquerywenzi_107.html
相关文章推荐
- 鼠标经过图片显示文字,鼠标移除时文字隐藏
- 鼠标经过渐变显示文字,隐藏图片
- jQuery hover事件鼠标滑过图片半透明标题文字滑动显示隐藏
- DIV CSS鼠标经过悬停在图片上时图片上方显示文字
- DIV CSS鼠标经过悬停在图片上时图片上方显示文字
- js和css两种实现鼠标经过图片时显示透明框的遮罩条文字
- 鼠标经过图片时图片上出现文字,鼠标移出时隐藏
- 鼠标经过图片时显示半透明文字,边框变色
- jQuery hover事件鼠标滑过图片半透明标题文字滑动显示隐藏
- 鼠标经过图片时显示半透明文字.net
- DIV CSS鼠标经过悬停在图片上时图片上方显示文字(转)
- 鼠标经过图片时显示半透明文字,边框变色
- 纯css3鼠标经过图片显示描述特效
- js实现鼠标悬停文字上显示图片
- 55-003-1 HTML5实现文字标题列表显示--鼠标经过时文字动态阴影展示
- js实现图片显示局部,鼠标经过显示全部的效果
- HTML5----图片或文字指定位子隐藏到显示动态效果
- 图片自动缩放比例,鼠标经过显示介绍+插件
- CSS实现鼠标放图片上显示白色边框+文字描述
- 鼠标滑过图片,图片上出现一个遮罩层并显示图片的提示文字