使用jQuery实现图片遮罩半透明坠落遮挡

2019-12-18,,,,,,

默认九宫格图片排列效果,当鼠标悬停在图片上后,会从图片的上方下滑一个半透明遮罩的效果

同时出现一些文字介绍

使用方法:

1、将head中的css样式引入到你的网页中
2、将代码部分拷贝到你的网页body结束前的地方即可
(js、图片采用绝对路径,不建议修改)

复制代码 代码如下:
$(function(){
    $('.sgw_img dt').hover(function(){
        $(this).children('.box').stop(true,true).delay(100).animate({'top':0,opacity:0.8},300);
    },function(){
        $(this).children('.box').stop(true,true).animate({'top':-482,opacity:0},200);
    })
    $('.sgw_img dd').hover(function(){
        $(this).children('.box').stop(true,true).delay(100).animate({'top':0,opacity:0.8},300);
    },function(){
        $(this).children('.box').stop(true,true).animate({'top':-382,opacity:0},200);
    })
})

以上就是本文分享的全部内容了,希望大家能够喜欢。

您可能感兴趣的文章:

  • jQuery移动页面开发中的触摸事件与虚拟鼠标事件简介
  • jQuery鼠标事件汇总
  • jQuery响应鼠标事件并隐藏与显示input默认值
  • IE8下jQuery改变png图片透明度时出现的黑边
  • jQuery fadeTo方法调整图片的透明度使用介绍
  • jQuery图片轮播的具体实现
  • 基于Jquery的简单图片切换效果
  • Jquery实现点击切换图片并隐藏显示内容(2种方法实现)
  • jQuery-onload让第一次页面加载时图片是淡入方式显示
  • Jquery中使用show()与hide()方法动画显示和隐藏图片
  • jQuery实现响应鼠标事件的图片透明效果【附demo源码下载】

《使用jQuery实现图片遮罩半透明坠落遮挡.doc》

下载本文的Word格式文档,以方便收藏与打印。