<style>
/* 隐藏默认的overlay */
#my-overlay-1.e-con:before{
opacity:0;
}
</style>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
//随鼠标移入移出更改overlay透明度
$(document).on("mouseenter","#my-overlay-1",function(){
$(this).append('<style>#my-overlay-1.e-con:before{opacity:0.4}</style>');
})
$(document).on("mouseenter","#my-overlay-2",function(){
$(this).append('<style>#my-overlay-2.e-con:before{opacity:0.4}</style>');
})
$(document).on("mouseleave","#my-overlay-1",function(){
$(this).append('<style>#my-overlay-1.e-con:before{opacity:0}</style>');
})
$(document).on("mouseleave","#my-overlay-2",function(){
$(this).append('<style>#my-overlay-2.e-con:before{opacity:0}</style>');
})
// 箭头上下移动效果
$(document).ready(function(){
setInterval(function(){
$("#my-round-arrow").animate({top:"10px"},600).animate({top:"0px"},600);
},1200)
})
</script>
wordpress elementor background overlay层 inert headr and footer动态切换透明度
于 2023-03-03 14:42:48 首次发布