の効果を置くために、マウスの画像のJQバージョン

ページの効果は、多くの場合、比較、jQueryの効果を使用して書かれているこの記事で紹介した画像のホバー効果で使用ImageHover.css互換性の改善。

互換性

プラグインの使用がjquery記述されたので、より互換性ImageHover.css良好。あなたは検討する勧告の互換性を考慮していない場合はImageHover.cssよりこのプラグインスタイルを。

デモ住所

画像

Demohttp://weber.pub/demo/160920/index.html

ダウンロード

直接ダウンロード

リンク:http://pan.baidu.com/s/1qXPy5y8パスワード:7b8i

使用

  • 1、CSSスタイルコード

.hover-down{
    width: 285px;
    height: 150px;
    position: relative;
    overflow: hidden;
}
.hover-down img{
    position: absolute;
}
.hover-down .hd-font{
    position: absolute;
    width: 285px;
    height:150px;
    z-index: 1;
    margin-top: -150px;
    color: #ddd;
    background: #000;
    filter:alpha(opacity=80);
    -moz-opacity:0.8;
    opacity: 0.8;
}
.hd-font span{
    padding: 20px;
    font-size: 14px;
    display: inline-block;
    line-height: 18px;
}
.hover-up{
    width: 285px;
    height: 135px;
    position: relative;
    overflow: hidden;
    background: #fff;
}
.hover-up img{
    width: 100px;
}
.hover-up .hu-font{
    height: 135px;
    width: 285px;
}
.hover-up .qr{
    position: absolute;
    width: 285px;
    height:135px;
    line-height: 135px;
    z-index: 1;
    margin-bottom: -135px;
    background: #fff;
    text-align: center;
}
.hover-up a{
    color: #4b8ce5;
}
.hover-up a:hover{
    color: #f8b600;
}
  • 2、HTMLコード

<div class="hover-down">
    <div class="hd-font">
        <span>web.pub测试文字测试web.pub测试测试文字</span>
    </div>
    <img src="img/11.jpg" alt="web.pub测试文字测试">
</div>
<div class="hover-up">
    <div class="hu-font center pr-lg pl-lg">
        <p class="f-20 c-333 mb-xs pt-md">web.pub</p>
        <p class="f-14 c-666 mb-none">web开发者-努力学习中、、</p>
        <hr class="solid mt-md mb-md">
        <a href="" class="">参观网站</a>
    </div>
    <div class="qr">
        <img src="img/qr.png" alt="web.pub">
    </div>
</div>
  • 3、JSコード(jQueryのを導入する必要があります)

$('.hover-down').hover(function () {
    $(this).addClass(' case-test');
    $('.case-test .hd-font').animate({marginTop:'0px'},'1000')
},function () {
    $('.case-test .hd-font').animate({marginTop:'-150px'},'1000')
    $(this).removeClass(' case-test');
})
$('.hover-up').hover(function () {
    $(this).addClass(' case-test');
    $('.case-test .qr').animate({marginTop:'-135px'},'1000')
},function () {
    $('.case-test .qr').animate({marginTop:'0px'},'1000')
    $(this).removeClass(' case-test');
})

デモ住所:http://weber.pub/demo/160920/index.html

エンディング

Weber.pub

この記事のアドレス:マウスホバー効果/211.htmlの画像のhttp://weber.pub/jqバージョン

:この記事はで再現されたAPE→2048 https://www.mk2048.com/blog/blog.php?id=hh2ch0j12jb

おすすめ

転載: www.cnblogs.com/baimeishaoxia/p/12604502.html