/ Published in: JavaScript
Thanks to [James](
http://www.girsbrain.org/blog
) for this code.
http://www.girsbrain.org/blog
) for this code.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(document).ready(function() { // Take all divs that match class .admin-links and move them inside of // the next adjacent sibling div with class .block. var $blocks = $(".block"); $blocks.each(function() { var $block = $(this); var $admin = $(this).prev(); if (!$admin.hasClass("admin-links")) return $block; var $copy = $admin.clone(true); $admin.remove(); $copy.prependTo($block); }); });