css3实现的六边形蜂窝状图片(自适应)

所属分类:UI-悬停

 15155  165  查看评论 (0)
分享到微信朋友圈
X
css3实现的六边形蜂窝状图片(自适应) ie兼容10

更新时间:2020-01-02 22:13:12

//页面渲染
var str = ''
for (var i = 0; i < 19; i++) {
    str += '<div >' +
        '<div >' +
        '<img  src="./images/amherst.png">' +
        '<span ></span>' +
        '<div >内容</div>' +
        '</div>' +
        '</div>'
};
$('.imgBox').html(str);
//显示效果
$('.imgBox>.hex').hover(function(e) {
    $(this).parent().find('.img').css('opacity', .2);
    $(this).siblings('.hex').find('.mark').hide();
    $(this).parent().find('.text_box').hide();
    $(this).find('.img').css('opacity', 1);
    $(this).find('.mark').show();
    $(this).find('.text_box').show();
    var domLeft = e.target.offsetParent.offsetLeft;
    var domLeft = e.target.x;
    var winWidth = document.body.clientWidth;
    var markWidth = $(this).find('.text_box').width();
    if (winWidth - domLeft <= markWidth) {
        $(this).find('.text_box').css({
            left: 'unset',
            right: '114%'
        });
    };
}, function() {
    $(this).parent().find('.img').css('opacity', 1);
    $(this).parent().find('.mark').hide();
    $(this).parent().find('.text_box').hide();
})
相关插件-悬停

jQuery鼠标悬停方向感知移入效果

jQuery简单实现鼠标各方为移入 代码简单易懂适合初学这阅读
  悬停
 34948  481

jQuery+Css3鼠标不同方向移入效果

jQuery鼠标方向感知,不同方向移入移除效果
  悬停
 27629  365

60种css3鼠标悬停效果

一款使用的效果,数遍悬停会出现相应图片的简介
  悬停
 61827  931

jQuery鼠标悬停方向感知

jQuery鼠标悬停方向感知,穿墙效果
  悬停
 28417  345

讨论这个项目(0)回答他人问题或分享插件使用方法奖励jQ币 评论用户自律公约

😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
取消回复