auto scrolling at certain point?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
sarris
Forum Contributor
Posts: 137
Joined: Mon Dec 04, 2006 2:44 pm

auto scrolling at certain point?

Post by sarris »

Hi there, i have a table and in that table one cell of it has this div

Code: Select all

<div id = "listdiv" style="width:600px;height:400px;overflow:auto;" onmouseover="mouseover_list();" onmouseout="mouseout_list();">
in that div i add smaller tables, creating kind of a list with info

Code: Select all

mylist = document.getElementById("listdiv");
var small_info = document.createElement("table");
small_info.innerHTML = htmlstring;
All those info table are listed in another way on another cell of the table...What i want to do is to highlight the litle table in that div whenever i hover the mouse over the elements on the other listing.
So far i managed to add a border, didnt manage to change the color of it.
Moreover (and mainly) though i would like the div to automatically scroll so the highlighted table shows in the scrollable cell
my code conserning that is

Code: Select all

function highlight_on_list(id){
      small_info = document.getElementById(id);
      small_info.setAttribute("border" ,"1");
      small_info.setAttribute("bordercolor","#003366");
}

function highlight_out_list(id){
      small_info = document.getElementById(id);
      small_info.setAttribute("border" ,"0");
}
thanks
Post Reply