页面在fadeOut之后移动(Page moves after fadeOut)

编程入门 行业动态 更新时间:2024-10-06 01:46:53
页面在fadeOut之后移动(Page moves after fadeOut)

我是jQuery编程的新手,想要在淡入效果后解决页面更改。 我听说使用回调方法。 但不知道怎么用请给我一些建议!!! “Scene2.html”是我想要移动的地方。

enter code here <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> jQuery(function(){ $("#first").fadeOut(1500); }); </script> </head> <body> <img id="first" src="images/Logop.jpg"/> </body> </html>

I'm new to jQuery programming and want to solve page changes after fading effect. I heard that using callback method. but don't know how to use please give me some advice!!! "Scene2.html" is where I want to move.

enter code here <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> jQuery(function(){ $("#first").fadeOut(1500); }); </script> </head> <body> <img id="first" src="images/Logop.jpg"/> </body> </html>

最满意答案

你这样做:

jQuery(function(){
$("#first").fadeOut(1500, function() {
	window.location.href = 'Scene2.html';
  });
}); 
  
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<img id="first" src="http://cdn.hark.com/images/000/003/249/3249/original.jpg"> 
  
 

You'd do it this way:

jQuery(function(){
$("#first").fadeOut(1500, function() {
	window.location.href = 'Scene2.html';
  });
}); 
  
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<img id="first" src="http://cdn.hark.com/images/000/003/249/3249/original.jpg"> 
  
 

更多推荐

本文发布于:2023-08-07 18:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465249.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页面   fadeOut   moves   Page

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!