jquery滑动图片显示标题遮罩层

jquery滑动图片显示标题遮罩层

本文演示了图片列表中,鼠标悬浮标题会以动画效果弹出,鼠标离开后,又会立即隐藏。这样的效果我们通常叫遮罩层滑动。

淘建站为您提供更多_图片代码_图片滑动_遮罩层,在此特别感谢您对我们的支持与厚爱!

查看演示

演示不了,点击反馈

加入收藏

下载 222 次

打赏作者

觉得不错,可打赏下作者

下载资源

免费共享

特别说明:本站资源来自网友发布分享,仅供学习与参考,请勿用于商业用途,若有侵权请联系删除(272966172@qq.com)。

图片和遮罩层html代码

<div class='thumbnailWrapper'>
    <ul>
        <li> 
            <a href='http://www.sucaiq.com/js/587.html' target='_blank'> <img src='images/1.jpg' alt='jQuery8种不同的懒加载loading效果' /> </a>
            <div class='caption'>
                <p class='captionInside'>jQuery8种不同的懒加载loading效果</p>
            </div>
        </li>
        <li> 
            <a href='http://www.sucaiq.com/js/588.html' target='_blank'> <img src='images/2.jpg' alt='鼠标悬浮图片背景变黑白的Masonry瀑布流插件' /> </a>
            <div class='caption'>
                <p class='captionInside'>鼠标悬浮图片背景变黑白的Masonry瀑布流插件</p>
            </div>
        </li>
    </ul>
</div>
//当鼠标悬浮在图片...
$('.thumbnailWrapper ul li').hover(function() {
    $(this).find('img').stop().animate({
        /* increase the image width for the zoom effect*/
        width: parseInt(thumbnail.imgWidth) + thumbnail.imgIncrease,
        /* we need to change the left and top position in order to 
         have the zoom effect, so we are moving them to a negative
         position of the half of the imgIncrease */
        left: thumbnail.imgIncrease / 2 * (-1),
        top: thumbnail.imgIncrease / 2 * (-1)
    }, {
        "duration": thumbnail.effectDuration,
        "queue": false
    });
    //show the caption using slideDown event
    $(this).find('.caption:not(:animated)').slideDown(thumbnail.effectDuration);
}, function() { //鼠标离开
    //find the image and animate it...
    $(this).find('img').animate({
        /* get it back to original size (zoom out) */
        width: thumbnail.imgWidth,
        /* get left and top positions back to normal */
        left: 0,
        top: 0

    }, thumbnail.effectDuration);
    //hide the caption using slideUp event
    $(this).find('.caption').slideUp(thumbnail.effectDuration);
});

声明:本资料由淘建站会员提供,如转载注明来源,资料来源淘建站免费素材库:https://www.taojz.cn/texiao/670.html
jquery滑动图片显示标题遮罩层 希望对你有帮助,感谢您的支持!
  • 纯CSS3写的10种不同的酷炫图片遮罩层效果

    纯CSS3写的10种不同的酷炫图片遮罩层效果

  • 用户登录遮罩层弹窗效果

    用户登录遮罩层弹窗效果

  • js遮罩层

    js遮罩层

  • 留言(0)
    头像
     阿里云限量代金券,戳我领取
    1 2