E
evanburen
I'm looking for possible ways of doing this with javascript so this
question is pretty broad but I have a string like this coming from a
database.
strDivOrder = "Div3,Div5,Div1,Div2"
The string could contain values from Div1 to Div16 in any order. I
want to arrange 16 div sections on a page based on which values are in
strDivOrder. In this example, Div3 would be displayed first on the
page, Div5 would be second etc.
For example,
<div id="Div1">
'This should be position 3 on the page
</div>
<div id="Div2">
'This should be position 4 on the page
</div>
<div id="Div3">
'This should be position 1 on the page
</div>
<div id="Div4">
'This should not be displayed at all
</div>
<div id="Div5">
'This should be position 2 on the page
</div>
<div id="Div6">
'This should not be displayed at all
</div>
<div id="Div7">
'This should not be displayed at all
</div>
question is pretty broad but I have a string like this coming from a
database.
strDivOrder = "Div3,Div5,Div1,Div2"
The string could contain values from Div1 to Div16 in any order. I
want to arrange 16 div sections on a page based on which values are in
strDivOrder. In this example, Div3 would be displayed first on the
page, Div5 would be second etc.
For example,
<div id="Div1">
'This should be position 3 on the page
</div>
<div id="Div2">
'This should be position 4 on the page
</div>
<div id="Div3">
'This should be position 1 on the page
</div>
<div id="Div4">
'This should not be displayed at all
</div>
<div id="Div5">
'This should be position 2 on the page
</div>
<div id="Div6">
'This should not be displayed at all
</div>
<div id="Div7">
'This should not be displayed at all
</div>