页面在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">
更多推荐
发布评论