[英]fade in div inside php using javascript after delay on page load?
嗨,有人知道您是否可以像下面這樣控制php中的div?
我想嘗試找到一種方法,在頁面加載3秒后使用javascript淡入div嗎?
誰能告訴我這樣做的方法?
我會想象它是這樣的:
<script>
jQuery(document).ready(function($){
$('.dashboard_intro').hide().delay(2000).fadeIn(2000);
$('.dashboard_intro_arrow').hide().delay(2000).fadeIn(2000);
$('.dashboard_intro_text').hide().delay(2000).fadeIn(2000);
$('.exit_intro').hide().delay(2000).fadeIn(2000);
});
</SCRIPT>
<?php
$dashboard_intro = dashboard_intro();
while ($intro = mysql_fetch_array($dashboard_intro))
if ($intro['dashboard_intro'] == '0') {
echo "<div class=\"dashboard_intro_arrow\"></div><div class=\"dashboard_intro\"></div><div class=\"dashboard_intro_text\"><strong>Welcome to Your Dashboard</strong><br/><br/>These are your tools: Check Messages, Reviews & more.</div><div class=\"exit_intro\"></div>";
} ?>
PHP在服務器上運行,不會影響jQuery稍后在瀏覽器中執行的操作。 呈現的HTML是什么樣的? 像您的示例代碼之類的東西應該可以正常工作。 到底是什么問題? 這是一個簡單的演示:
<script>
$(function() {
$('.dashboard_intro_text').delay(3000).fadeIn(2000);
});
</script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.