Thanks to all who answer my preview post.
Now I'll try to describe what I'm doing and what doesn't work.
I'm doing a code to move objects (images) in a specified user order,
through arrow up and down symbols. When the user clicks on this symbol,
the clicked object (in the array) change the position for the clicked
element +1 / -1 (up, down), and the old element take the position of the
clicked.
I need the image name, the present position, and the image ID. I have
this array.
var Thumbnails = new Array();
Thumbnails[0] = new Array('1','sexy 2.jpg','Sexy',' 3');
Thumbnails[1] = new Array('2','blue-sun-m.jpg','New Test','4');
Thumbnails[2] = new Array('3','list ing_34.jpg','Ho me View','1');
Thumbnails[3] = new Array('4','fire fox_eats_ie.jpg ','Firefox','2' );
The first element is the order position.
The second is the image name.
The third is a Title for the image.
And the last one, is the image ID.
I have a function to move this elements, when the user clicks one,
everything works fine, excepts the following code.
// cnt : is the ID of the image the user clicked.
var Order1 = Thumbnails[cnt][0];
var Order2 = Thumbnails[new_cnt][0];
..
..
..
/*
this work, but when I try to move the element again, it shows the
original order number (first element on the array), but should say the
old element (cnt) +1 / -1. But it doesn't work...
*/
Thumbnails[cnt][0] = Order2;
Thumbnails[new_cnt][0] = Order1;
I think... I need to reload the browser, to put the new values in the
array, but I don't want to refresh the Window. It's like the changes I
make are stored in memory but, when I try to query them I receive the
original values.
I would greatly apprciate any help understanding what is happening.
-- eft0.
Now I'll try to describe what I'm doing and what doesn't work.
I'm doing a code to move objects (images) in a specified user order,
through arrow up and down symbols. When the user clicks on this symbol,
the clicked object (in the array) change the position for the clicked
element +1 / -1 (up, down), and the old element take the position of the
clicked.
I need the image name, the present position, and the image ID. I have
this array.
var Thumbnails = new Array();
Thumbnails[0] = new Array('1','sexy 2.jpg','Sexy',' 3');
Thumbnails[1] = new Array('2','blue-sun-m.jpg','New Test','4');
Thumbnails[2] = new Array('3','list ing_34.jpg','Ho me View','1');
Thumbnails[3] = new Array('4','fire fox_eats_ie.jpg ','Firefox','2' );
The first element is the order position.
The second is the image name.
The third is a Title for the image.
And the last one, is the image ID.
I have a function to move this elements, when the user clicks one,
everything works fine, excepts the following code.
// cnt : is the ID of the image the user clicked.
var Order1 = Thumbnails[cnt][0];
var Order2 = Thumbnails[new_cnt][0];
..
..
..
/*
this work, but when I try to move the element again, it shows the
original order number (first element on the array), but should say the
old element (cnt) +1 / -1. But it doesn't work...
*/
Thumbnails[cnt][0] = Order2;
Thumbnails[new_cnt][0] = Order1;
I think... I need to reload the browser, to put the new values in the
array, but I don't want to refresh the Window. It's like the changes I
make are stored in memory but, when I try to query them I receive the
original values.
I would greatly apprciate any help understanding what is happening.
-- eft0.
Comment