views:

145

answers:

2

hello guys,

Here i have a probs,

i wanna sift automatically a div when it's right side element is removed from document. let all the elements are start from the right to left side like D C B A. in above example A is the first Div B is Second and so on. what i want that when i removed element A, the element B that was after A will be shift automatically at the position of a.

please tell me something if anyone have any idea about it.

thanks.

A: 

Hi,

You have to assign div align="right" to all div elements. When one div is deleted all other will shift to right automatic. I think this will work.

prakash.panjwani
A: 

To achieve this effect you can use the css float: right;:

<div id='A' style='float:right;'>A</div>
<div id='B' style='float:right;'>B</div>
<div id='C' style='float:right;'>C</div>

If you remove A from the DOM then B will float automaticly to the right.

Take a look to SELFhtml too:

http://de.selfhtml.org/navigation/suche/index.htm?Suchanfrage=float

To do the removal via javascript you could use jQuery

<script type="text/javascript">
  $('#A').hide();
</script>
Joe
Thanks dear, i applied this attributes to all divs But it's not working.i think to work it the page should be refreshed but i am removing element by javascript so .....
Abhisheks.net
I postet a suggestion how to hide it via jQuery. This works with the floating as well.
Joe
nops dear i dont want that, removing of element is running successfully but after removing the first div, removing div's should be shifted to right but its not going. like thislet E D C B A all of the are div'snow if i removed a then it should be like thisE D C Band now if i removed c thenE D B.
Abhisheks.net
Ok, then how do you perform the removal? Can you post some code to test your problem?
Joe
nothing special. i only called a function in which the div id is passed as a parameter and the i found its parent element after that just removeChild.
Abhisheks.net
thank to reply me
Abhisheks.net
Reply me soon dear, i really need of it too much.
Abhisheks.net
Please post some code so we can reproduce your problem. The code above should already do what you described.
Joe