我遇到prototype.js模态问题和<div>
刷新功能。
我尝试通过点击顶部菜单中的链接创建一些模态。但是当模态函数执行时,<div>
元素就会消失。
为什么会这样?
$(document).ready(function() {
$("#presenti").load("presenti.php");
var refreshId = setInterval(function() {
$("#presenti").load('presenti.php?randval=' + Math.random());
}, 5000);
});
$(document).ready(function() {
$("#sms").load("message.php");
var refreshId = setInterval(function() {
$("#sms").load('message.php?randval=' + Math.random());
}, 10000);
});
$(document).ready(function() {
$("#lallero");
var refreshId = setInterval(function() {
$("#lallero").load(location.href + " #lallero");
}, 3000);
});
整个HTML
<html>
0){echo“(”。$ NonLetti。“)Teen Wolf GDR”;} else {echo“Teen Wolf GDR”; ?}&GT;
<table width="100%" height="100%" cellpadding=0 cellspacing=0>
<!-- colonna sinistra!-->
<td style="background-image:url('image/main/pattern_colonna.png');" valign="top">
<table cellpadding=0 cellspacing=0>
<tr>
<td width="214" height="220" style="background-image:url('img/luoghi/<?= $Immagine ?>');background-repeat:no-repeat;border-bottom:0px solid #0b0b0b;">
<div id="info_loc">
<a href="javascript: void(0)" onClick="Javascript:window.open('guarda.php?ID=<?= $_SESSION['Stanza'] ?>','look','height=600,width=700,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes')">
<img src="image/main/cornice_loc.png" width="214" height="220" class="img_ombra">
</a>
</div>
</td>
</tr>
<tr>
<td style="height:59px;position: absolute;">
<a href="javascript: void(0)" onClick="Javascript:window.open('documentazione.html','doc','height=620,width=840,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes' )">
<img src="image/main/doc3.png" class="fade" >
</a>
</td>
</tr>
<tr>
<? if ((strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) OR (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== FALSE) OR (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE) OR (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== FALSE) OR (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== FALSE) OR (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== FALSE)) { ?>
<td style="height:69px;position: absolute; top:279px;">
<? } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE) { ?>
<td style="height:69px;position: absolute; top:283px;"><? } ?>
<span id="sms" ></span>
</td>
</tr>
<? $Mynoti = mysql_query("SELECT * FROM Agenda WHERE Data >= NOW() AND Data <= DATE(NOW() + INTERVAL 1 DAY) AND Creatore = '$Login'");
$row = mysql_fetch_array($Mynoti);
if ($row['Evento'] != '') {
$testolozzo = "Lo Staff ti ricorda che in Data <b>".($row['Data'])."</b> avrà luogo l'evento <b>".$row['Descrizione']."</b> da te salvato in Agenda. <u>Ulteriori dettagli</u>: ".$row['Evento']."";
$testolozzo = mysql_real_escape_string($testolozzo); ?>
<tr><td style="position: absolute; top:342px; left: 25px" align=center width="180px"><div style="margin:0px auto; padding-top:0px;border:1px solid #1a1a1a;"><a href="messaggioagenda.php" target=palestra><img src="image/main/promemoriaagenda.gif" dynsrc="image/main/promemoriaagenda.gif" loop=infinite></a></div></td></tr> <? } ?>
<tr>
<td align=center>
<div id="presenti">
</div>
</td>
</tr>
</td>
<!-- colonna centrale /frame !-->
<td style="width:100%;background-image:url('image/main/pattern_colonna.png');" valign=top align=center>
<div id="lallero"><?php include ('refreshable.php'); ?></div>
<table style="width:100%;height:95%;" cellpadding=0 cellspacing=0>
<tr><td>
<!-- qui va l'iframe !-->
<? if ($Situazione != "") { ?><div id="news2"><iframe src="situazionechat.php" width="100%" height="100%" frameborder="no" scrolling="no" ></iframe></div>
<iframe width="100%" height="94%" src="<?= $Link ?>" frameborder="no" name="palestra"></iframe><? } else { ?>
<iframe width="100%" height="100%" src="<?= $Link ?>" frameborder="no" name="palestra"></iframe><? } ?>
</td></tr>
</table>
</td>
<!-- colonna destra!-->
<td style="background-image:url('image/main/pattern_colonna.png');" valign="top">
<table width="200" cellpadding=0 cellspacing=0>
<tr>
<?php
$mini = mysql_fetch_array(mysql_query("select mini_avatar from Personaggio where Nome = '".$_SESSION['Login']."'"));
?>
<td width="150" height="150" style="background-size: 150px 150px; background-position: center; background-image:url('<?= $mini['mini_avatar'] ?>');background-repeat:no-repeat;border-bottom:0px solid #0b0b0b;">
<div id="mini_avatar">
<a href="javascript: void(0)" onClick="Javascript:window.open('scheda.php?pg=<?= $Login ?>','look','height=650,width=700,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes')"><img src="image/main/cornice_miniavatar.png" style="margin-left: 24px; margin-top: -2px; width: 152px; height: 152px;"></a>
</div>
</td>
</tr>
</table>
<table width="150" height="15px" cellpadding=0 cellspacing=0 align=center><tr><td align=right>
<? if ($pg['Dispo'] == '0') { echo "<font famili=Verdana color=#707070 size=2px>Disponibilità attuale:</font> <img src='image/presenti/pallaverde.png' widht=12px height=12px>"; }
if ($pg['Dispo'] == '1') { echo "<font famili=Verdana color=#707070 size=2px>Disponibilità attuale:</font> <img src='image/presenti/pallarossa.png' widht=12px height=12px>"; }
if ($pg['Dispo'] == '2') { echo "<font famili=Verdana color=#707070 size=2px>Disponibilità attuale:</font> <img src='image/presenti/pallagialla.png' widht=12px height=12px>"; }
if ($pg['Dispo'] == '3') { echo "<font famili=Verdana color=#707070 size=2px>Disponibilità attuale:</font> <img src='image/presenti/pallablu.png' widht=12px height=12px>"; }
if ($pg['Dispo'] == '4') { echo "<font famili=Verdana color=#707070 size=2px>Disponibilità attuale:</font> <img src='image/presenti/pallaarancio.png' widht=12px height=12px>"; }
if ($pg['Dispo'] == '5') { echo "<font famili=Verdana color=#707070 size=2px>Disponibilità attuale:</font> <img src='image/presenti/pallaviola.png' widht=12px height=12px>"; } ?>
</td></tr></table>
<table width="200" style="margin-top:20px" height="25" cellpadding=0 cellspacing=0>
<tr>
<td align=center>
<div id="tarallo">
<a href="javascript: void(0)" onClick="Javascript:window.open('lotteria1.php','lottery','height=650,width=700,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes')" class="menu_top">
<img src="image/main/lotteria.png"/>
</a>
</div>
</td>
</tr>
<tr>
<td align=center>
<div id="tarallo">
<a href="javascript: void(0)" onClick="Javascript:window.open('calendar/index.php','calendar','height=400,width=500,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes')" class="menu_top">
<img src="image/main/calendario.png"/>
</a>
</div>
</td>
</tr>
<tr>
<td align=center>
<div id="tarallo">
<a href="main.php?Dir=77#" target="_top" class="menu_top">
<img src="image/main/accoglienza.png"/>
</a>
</div>
</td>
</tr>
<tr>
<td align=center valign="top">
<div id="tarallo"><a href="logout.php" onClick="return Conferma();"target="_top" class="menu_top" name="exit" method=post>
<img src="image/main/exit.png" class="tarallo" width=150 height=21 ></a>
</div>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<div id="meteo"><? if ($zonetta =='0') { ?>
<? include('meteo.php');?> <? } elseif ($zonetta =='1') { ?><? include('meteot.php');?><? } ?>
</div>
</td>
</tr>
</table>
<? $musica=mysql_query("select * from Personaggio where Nome='$Login'");
$s=mysql_fetch_array($musica);
if (($Musica != "")&&($s['musicachat']==0)) { ?>
<table width="200" style="margin-top:5px" cellpadding=0 cellspacing=0>
<tr>
<td align=center valign=bottom><div style="background-image:url('/image/main/pattern_riquadri.png');margin:0px auto; padding-top:0px;border:1px solid #000;
width:160px; height:20px;margin-top:5px;">
<iframe src="musicachat.php" width="152" height="20" frameborder="no" scrolling="no" frameborder="1"></iframe>
</div></td>
</tr>
<tr>
<td align=center>
<div style="background-image:url('/image/main/pattern_riquadri.png');margin:0px auto; padding-top:0px;border:1px solid #000;
width:160px; height:210px;margin-top:10px;">
<iframe src="scroll_news.php" width="160" height="210" frameborder="no" scrolling="no" ></iframe>
</div>
</td>
</tr>
</table><? } else { ?>
<table width="200" style="margin-top:5px" cellpadding=0 cellspacing=0>
<tr>
<td align=center>
<div id="news" >
<iframe src="scroll_news.php" width="160" height="225" frameborder="no" scrolling="no" ></iframe>
</div>
</td>
</tr>
</table>
<? } ?>
<table width="200" cellpadding=0 cellspacing=0>
<tr>
<td align=center valign="bottom" align="right">
</td>
</tr>
</table>
</td>
</table>
答案 0 :(得分:0)
好的,我做到了。
我只是设置了这个:
red div
并使用$ j更改了Jquery中的所有$ for div Refresh。
谢谢大家! :)