弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 810|回复: 0

TabStrip左栏目触发右图片区向上渐显动画

[复制链接]
发表于 2022-1-27 23:49:52 | 显示全部楼层 |阅读模式
本次脚本在模板220117验证。

DIV:
<div class="product container py-5">
    <div class="row">
        <div class="d-flex ul-lg-3 eye margin-t-5 bg-li-white">$func_tabstrip(navi=nav,para=Product,disp=2,len=8,rows=6,title=11)$
        </div>
    </div>
</div>


JS:
var o, len, last, timer;
$(function () {
    o = $(".product .Content .TabNavContent .TabContent").removeAttr("style");
    $(".product .Content").css({ "overflow": "hidden" });
    len = o.length;
    last = len - 1;
    var i=0;
    $(".TabTitle").on("mouseout", function () { ShowTabContent("", i, len); });
    ShowTabContent("", i, len);
});
function ShowTabContent(id, i, j) {
    clearTimeout(timer);
    if (i == 0) { last = len - 1; }
    console.log(i + "," + last);
    o.attr("animate", "backOutUp").removeClass("hide");
    o.eq(i).attr("animate", "backInUp");
    last = parseInt(i);
    i = 1 + parseInt(i);
    if (parseInt(i) >= parseInt(len)) { i = 0; }
    timer = setTimeout(function () { ShowTabContent(id, i, j) }, 5000);
}

CSS:
@keyframes backOutUp {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    20% {
        transform: translateY(0px) scale(0.7);
        opacity: 0.7;
    }

    100% {
        transform: translateY(-700px) scale(0.4);
        opacity: 0.4;
        display: none !important;
    }
}

[animate=backOutUp] {
    animation-name: backOutUp;
    animation-duration: 1s;
    display: none !important;
}

@keyframes backInUp {
    0% {
        transform: translateY(1200px) scale(0.4);
        opacity: 0.4;
        display: flex !important;
    }

    80% {
        transform: translateY(0px) scale(0.7);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

[animate=backInUp] {
    animation-name: backInUp;
    animation-duration: 1s;
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2024-4-27 01:27 , Processed in 0.093456 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表