Change div order in colorbox?

I would like to know if it is possible to change div order in colorbox ? I am just asking because cboxTitle-div is inside cboxContent-div. But I want cboxTitle-div to be inside colorbox-div.

From this...

<div id="cboxContent"> <div id="cboxTitle"></div> </div> 

to that...

 <div id="colorbox"> <div id="cboxTitle"></div> <div id="cboxContent"></div> </div> 

Can someone help me solve this problem or does anyone know another alternative? TIA.

+4
source share
2 answers

You can write a single jQuery line that would solve this and move the element:

 $("#cboxTitle").appendTo("#colorbox"); 
+3
source

Not sure why you would like to do this, but you could change it using jQuery using the append method

 $('body').append( '<div id="colorbox"></div>' ); $('#colorbox').append( $('#cboxTitle') ); $('#colorbox').append( $('#cboxContent') ); 
+1
source

All Articles