drpelz
drpelz

Reputation: 811

Change div-order in colorbox

I'd like to know if it's possible to change the div-order in colorbox? I just ask because the cboxTitle-div is inside of the cboxContent-div. But I want the cboxTitle-div to be inside of the colorbox-div.

From this...

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

to this...

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

How can I resolve this problem?

Upvotes: 4

Views: 429

Answers (2)

Patareco
Patareco

Reputation: 136

Not sure why you would want to do this but you could rearrange it with jQuery with the append method

$('body').append( '<div id="colorbox"></div>' );

$('#colorbox').append( $('#cboxTitle') );
$('#colorbox').append( $('#cboxContent') );

Upvotes: 1

Benjiman
Benjiman

Reputation: 420

You can write one line of jQuery that would solve this and move the element:

$("#cboxTitle").appendTo("#colorbox");

Upvotes: 3

Related Questions