如何在不影响背景的情况下对整个内容添加混合效果

How to add a blending effect on the entire content without affecting the background

本文关键字:添加 混合 影响 背景 情况下      更新时间:2023-09-26

如何在每次单击链接后加载新内容时添加混合效果?

我看过谷歌,大多数网站都提供的代码只是淡化图像或仅适用于该图像和整个页面的IE。我只是希望内容在加载到另一个页面时稍微混合一下,在从菜单中单击链接后显示下一个内容。

我只需要在每个内容之间进行轻微的混合。没有淡入或淡出只是混合。

很好的答案@codedude !!! 再次感谢!!

在这里找到这个: http://www.onextrapixel.com/2010/02/23/how-to-use-jquery-to-make-slick-page-transitions/

<script type="text/javascript">
$(document).ready(function() {
$("CONTENT TAG").css("display", "none");
$("CONTENT TAG").fadeIn(2000);
$("MENU LINK").click(function(event){
    event.preventDefault();
    linkLocation = this.href;
    $("CONTENT TAG").fadeOut(1000, redirectPage);      
});
function redirectPage() {
    window.location = linkLocation;
}
});
</script>

只需将"菜单链接"更改为链接元素的 id 或类即可。确保也包括jQuery。

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
例如,

可以使用标题部分中的元标记指定转换

<meta http-equiv="Page-Enter" content="revealTrans(Duration=**,Transition=?)">