Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 942735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:19:21+00:00 2026-05-15T22:19:21+00:00

I tried creating a disembodied DOM element with jQuery (I avoid ever touching the

  • 0

I tried creating a disembodied DOM element with jQuery (I avoid ever touching the DOM directly w/o going through jQuery, so I do treat their wrapped sets and the DOM elements underneath somewhat equivalently) and applying .tabs() to it, and only later adding the element into the DOM. The tabs kind of worked and kind of didn’t. It seemed as if (from a guess) perhaps event handlers had been messed up. Clicking on a tab highlighted it but did nothing. The non-currently-selected tab content was all shown. It was a weird effect.

I changed just one thing– I attached the disembodied element into the actual DOM tree first before calling .tabs(). Everything worked fine.

This actually fixed my immediate practical problem, because I did some more reading and realized that my whole motivation for making disembodied elements was based on a subtle misconception about how execution works in the browser between JavaScript and the DOM rendering. (I didn’t realize that the renderer would not regain control until the JavaScript had finished, which makes a lot more sense in retrospect– I’m sure a real multithreaded sort of approach would be a concurrency nightmare for browser makers…)

Anyway, that still leaves a very interesting theoretical question. What’s the deal? What’s the difference between the disembodied element and the attached one? How does jQuery UI play into that? I’d like to understand this stuff on a deeper level.

(I couldn’t find anything with a few cursory Google searches. Not surprised, since it seems that when you correct the misconceptions I had, running jQuery UI operations on disembodied elements is pretty pointless in practice.)

Here’s some code:

// doesn't work right
var disembodied = $('<div>.......html goes here....</div>');
$(disembodied).tabs();
$('div#receptacle').append( disembodied );

// does work right
var disembodied = $('<div>.......html goes here....</div>');
$('div#receptacle').append( disembodied );
$(disembodied).tabs();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:19:22+00:00Added an answer on May 15, 2026 at 10:19 pm

    The problem is that when the tabs code is searching for the panels for each tab it does a selector search on the body not the current element. This works when the tabs are already in the document but not when they are not.

    The fix is easy. Just change this line in the _tabify function

    self.panels = self.panels.add(self._sanitizeSelector(href));
    

    to

    self.panels = self.panels.add(self._sanitizeSelector(href), self.element);
    

    I have submitted a ticket to make this change in jQuery UI.
    http://dev.jqueryui.com/ticket/5857

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I tried creating the slide up down effect like in this example, http://paulsturgess.co.uk/articles/show/83-jquery-text-slide-up-slide-down-effect
I'm pulling a set of image urls and their respective titles. I've tried creating
I was looking at the tutorial at http://jqueryfordesigners.com/jquery-infinite-carousel/ . I tried creating something similar
Being horrible at the design end, I tried creating the above code and it
I recently tried using the Cloud9 online IDE . It starts by creating a
I am having trouble creating an entity using inout ports. I tried writing the
I have small library i want to use for creating games. First, i tried
I tried creating UIButtons from an Array of objects. I created these successfully by
Just tried creating a data connection to a SQL 2000 database in VS2010's Server
I tried creating a test plan as explained here . But the only problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.