1

I'm moving some stuff around on document ready. Think of it like a fancy tab navigation, where I have some dynamic content in a list navigation, that toggles between the different panels.

I do have control over the markup, but the ul is in a different template in the CMS from the one used to insert dynamic content, so I'm basically moving stuff around on document ready to get it where I want. It works great, except in IE7, where the move never occurs.

HTML:

<ul class="pnlHandler"></ul>

<div id="Panels">
   <li>Here goes the content that I want to move</li>
   <div class="pnlFront">
      This has more content, but it's already where I want it
   </div>
</div>

JS:

$(document).ready(function(){
   $("#Panels").children("li").appendTo(".pnlHandler");
});
Nix
  • 5,746
  • 4
  • 30
  • 51
  • 1
    You may have to remove them from the DOM first, then append them back to the `.pnlHandler`? I haven't tested this though... – Jon Adams Nov 22 '11 at 20:57
  • IE doesn't like having `
  • `'s outside of `
      `'s. So, my guess is that the `
    • ` is never put into the DOM to start with, try to put it in a `
        ` inside `#panels`. Also, your selector should be `$("#panels")` (lower case 'p').
  • – gen_Eric Nov 22 '11 at 20:58
  • @Rocket: The li does render, but it does seem to be behaving strangely. If I inspect it, it thinks the next div is a child element (as if the li was never closed), even though the HTML is valid. Also, the ID for #Panel is correct in my version, I just typed it in incorrectly here. :) – Nix Nov 22 '11 at 21:11