Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望能够根据网站请求的 url 触发动画。例如 www.site.com/index.php#houses
那么这会<div id="houses">淡入淡出吗?
<div id="houses">
有没有一种简单的方法可以做到这一点?
你可以试试这个:
$(function(){ $(window.location.hash).fadeIn(); });
试试这个:
function(){ var uri = window.location.pathname; if(uri.indexOf("#houses") > 0){ $("#houses").fadeIn(); } }