Hola a todo.
mi pregunta es saber si es posible guardar la posición de un scroller. Es decir. Tengo un DIV donde mediante un par de flechas sube y baja el texto de este. El texto en realida lo utilizo como menú de cursos. Y a primera vista aparecen 10, pero realmente hay más de 20. Subiendo y bajando el scroll voy hasta el curso en concreto lo selecciono y me lo despliega mediante php y mysql el curso seleccionado. El problema que me encuentro es que si selecciono uno que esté en la posición 18, al volver a recargar la página evidentemente no veo que se haya seleccionado, ya que queda fuera del rango de los 10 visible. Y debo ir con el scroll buscando hasta encontrar el curso seleccionado.
Es un problema ya que si quiero hacer un vistazo rápido atodos los cursos debo ir uno a uno y tirando del scroll. Si fueran 5 no hay problema, pero como digo,pueden llegar hasta 25 cursos distintos, y evidentemente es muy incómodo para navegar.
No se si me explico bien
Gracias por anticipado
Les dejo el código por si sirve de ayuda
Código HTML:
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="24" rowspan="2"><img src="myadmin/imatges/fons_menu_esq.jpg" width="24" height="19"></td>
<td background="myadmin/imatges/fons_menu_dot.jpg"><img src="myadmin/imatges/spacer.gif" width="30" height="2"></td>
<td width="22" rowspan="2"><img src="myadmin/imatges/fons_menu_dret.jpg" width="22" height="19"></td>
</tr>
<tr>
<th background="myadmin/imatges/fons_menu_dot.jpg"><div align="center"><A ONMOUSEDOWN="return doScrollerIE('up','s1',40)"
ONMOUSEOUT="clearInterval(sRepeat)" HREF="#"><img src="myadmin/imatges/up.jpg" width="28" height="9" border="0"></A></div></th>
</tr>
</table>
<DIV ID=s1 STYLE="width: 250; height: 100; overflow: hidden; border:0px black solid">
<?
$ssql = "SELECT * FROM cursos where id ='$id'";
$resulta = mysql_query($ssql,$conexion);
$rs=mysql_fetch_object($resulta);
$ssql = "SELECT * FROM cursos";
$result = mysql_query($ssql,$conexion);
while ($rss=mysql_fetch_object($result)){
?> <SCRIPT>
var sRepeat=null
function doScrollerIE(dir, src, amount) {
if (amount==null) amount=10
// Move the top of the contents up or down
// in the viewport
if (dir=="up")
document.all[src].scrollTop-=amount
else
document.all[src].scrollTop+=amount
// Check if to repeat
if (sRepeat==null)
sRepeat = setInterval("doScrollerIE('" + dir + "','" + src + "'," + amount + ")",100)
return false
}
// Used to end repeating scrolling
window.document.onmouseup = new Function("clearInterval(sRepeat);sRepeat=null")
window.document.ondragstart = new Function("return false")
</SCRIPT>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="24" rowspan="2" background="myadmin/imatges/fons_menu_esq.jpg"><img src="myadmin/imatges/fons_menu_esq.jpg" width="24" height="19"></td>
<td background="myadmin/imatges/fons_menu_linia.jpg"><img src="myadmin/imatges/spacer.gif" width="30" height="2"></td>
<td width="22" rowspan="2" background="myadmin/imatges/fons_menu_dret.jpg"><img src="myadmin/imatges/fons_menu_dret.jpg" width="22" height="19"></td>
</tr>
<tr>
<th <?php if ($id==$rss->id) print "bgcolor=\"#FFFFFF\""; else print "bgcolor=\"#01A8EC\""; ?> onMouseOver="filaMouseOver(this)" onMouseOut="filaMouseOut(this)" onClick="document.location='mostrar.php?id=<?php echo $rss->id;?>'"><div align="left"><img src="myadmin/imatges/spacer.gif" width="5" height="8" align="absmiddle"><?php echo $rss->Nom;?></div></th>
</tr>
</table>
<? } ?></div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="24" rowspan="2"><img src="myadmin/imatges/fons_menu_esq.jpg" width="24" height="19"></td>
<td background="myadmin/imatges/fons_menu_dot.jpg"><img src="myadmin/imatges/spacer.gif" width="30" height="2"></td>
<td width="22" rowspan="2"><img src="myadmin/imatges/fons_menu_dret.jpg" width="22" height="19"></td>
</tr>
<tr>
<th background="myadmin/imatges/fons_menu_dot.jpg"><div align="center"><A ONMOUSEDOWN="return doScrollerIE('down','s1',40)"
ONMOUSEOUT="clearInterval(sRepeat)" HREF="#"><img src="myadmin/imatges/down.jpg" width="28" height="9" border="0"></A></div></th>
</tr>
</table>