maya wrote:
Quote:
I'm using a function like this to load divs dynamically (and hide
current one..)
>
function get_img(curr_img,curr_nav,new_img,new_nav2) {
var img_top = eval('document.getElementById(' + "curr_img" + ')');
|
Why are you evaluating instead of just doing
var img_top = document.getElementById(cur_img);
??????????
Quote:
var img_new = eval('document.getElementById(' + "new_img" + ')');
var nav_top = eval('document.getElementById(' + "curr_nav" + ')');
var nav_new = eval('document.getElementById(' + "new_nav" + ')');
img_top.style.visibility = "hidden";
img_new.style.visibility = "visible";
nav_top.style.visibility = "hidden";
nav_new.style.visibility = "visible";
curr_img = new_img;
curr_nav = new_nav;
}
>
problem I always run into in situations like this is I can't tell which
one is currently loaded.. how do you detect which div is currently loaded?
|
Not enough information here to have any clue what you mean.
Quote:
this is in JSP, divs generated with loops...
>
for (int i = 0; i < photos.length; i++) {
%>
<div id="nav<%=photos[i]%>">
>
etc...
>
thank you.............
>
|