How to clone jquery-ui tabs to different loc
-
I tried to clone tabs element to different location by using clone(true) method but it didn't work properly. For example, I can not switch between tabs in '#here' div. Here is the html content: <body> <div id="tab1" class="tabs" style="height:100px; width:300px"> <ul></ul> </div> <div id="here" style="height:100px; width:300px"></div> </body> and this is the code which I tried: $('#tab1').tabs({ closable: true }); $('#tab1').tabs('add', '#' + 1, 'test'); $('#tab1').tabs('add', '#' + 2, 'test'); var tmp = $('#tab1').clone(true); tmp.appendTo($('#here')); I don't want to copy html tags and then reinitialize the tabs element like this: $('#tab1').tabs({ closable: true }); $('#tab1').tabs('add', '#' + 1, 'test'); $('#tab1').tabs('add', '#' + 2, 'test'); $('#here').html($('#tab1').html()); $('#here').tabs(); I actually want to relocate tabs, which has ui elements like jqgrid, jstree in it, to different div dynamically and the above code is not appropriate solution. thanks for your attention.
-
Answer:
If you want to reallocate i think you could use http://api.jquery.com/detach/ so that you can reappend the elements later var tab = $('#tab1').detach(); tab.appendTo($('#here'));
Ye Adam no family at Stack Overflow Visit the source
Related Q & A:
- How To Clone Website?Best solution by Drupal Answers
- How to clone git to a server?Best solution by Stack Overflow
- How do I turn on tabs?Best solution by Yahoo! Answers
- How do I turn off tabs with the Yahoo toolbar?Best solution by answers.yahoo.com
- How to clone a plant?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.