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

  • SEARCH
  • Home
  • 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 8918325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:43:23+00:00 2026-06-15T05:43:23+00:00

I found this Is it possible to move the text from an element to

  • 0

I found this Is it possible to move the text from an element to another using jquery animation? that is almost what I was looking for, but what I really cannot do is to obtain a smooth animation during the movement in my little different case.
Here the not-so-working example: http://jsbin.com/ofumil/7/edit

The button in the second tab should move from the tab to the upper div (where you see “selected”).

Can anybody understand my error?
Thanks

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js">    </script>
  <!-- <script src="./elgg/vendors/jquery/jquery-1.6.4.min.js"></script> -->
  <script>
    $(document).ready(function() {
      $("#tabs-left").tabs();
      $(".category").click(function(){
        changeDiv('#go', '#fragment-2', '#selicons');
        changedest();
      });
    });


    function changeDiv(what, source_id, target_id)
    {
    var clickedButton = $(what);
    var soff = $(source_id).offset();
    var eoff = $(target_id).offset();
    $('<div id="anim-shell"></div>').appendTo('body');
    $('#anim-shell').css( "background-color","yellow" );
    $('#anim-shell').css( { top: soff.top, left: soff.left } );
    clickedButton.appendTo('#anim-shell');
    $('#anim-shell').animate( { top: eoff.top+'px', left: eoff.left+'px' }, 1500, function() {
        clickedButton.appendTo(target_id)
        $('#anim-shell').remove();

        //$(target_id).text( _text );
    });
}
    function changedest(){
      document.getElementById("dest").href ="nuovohref.html"
    }; 

  </script>
  <style>

    #go{background-image:url('invia.gif');
    background-repeat:no-repeat;
    background-position:center center;
    width:100px;height:44px;
    background-color:0000ff;}
    //vertical tabs
    div#tabs-left {
        position: relative;
        padding-left: 200px;
    }

    div#tabs-left > div {
        min-height: 300px;
    }

    div#tabs-left .ui-tabs-nav {
        position: absolute;
        left: 0px;
        top: 0px;
        bottom: 0px;
        width: 195px;
        padding: 5px 0px 5px 5px;
    }

    div#tabs-left .ui-tabs-nav li {
        left: 0px;
        width: 195px;
        border-right: none;
        overflow: hidden;
        margin-bottom: 2px;
    }

    div#tabs-left .ui-tabs-nav li a {
        float: right;
        width: 100%;
        text-align: right;
    }

    div#tabs-left .ui-tabs-nav li.ui-tabs-selected {
        border: none;
        border-right: solid 1px #fff;
        background: none;
        background-color: #fff;
        width: 200px;
    }

    .content {
    position:relative;
    left:200px;
    background-color: #bcf;
    }
  </style>
</head>
<body >
<div id="selicons">
  <br>
  selected:<br>
  <br>
  <button id="search" >» trova</button>
  <a href="oldlink.htm" id="dest">link</a>
</div>
<div id="tabs-left">
    <ul>
        <li><a href="#fragment-1"><span>One</span></a></li>
        <li><a href="#fragment-2"><span>Two</span></a></li>
        <li><a href="#fragment-3"><span>Three</span></a></li>
    </ul>
    <div class= "content" id="fragment-1">
        <p >First tab is active by default:</p>
    </div>
    <div class= "content" id="fragment-2">
        <button id="go" class="category" style="position: absolute;left:100px;top:20px"></button>
        <button id="go1" class="category" style="position: absolute;left:100px;top:20px"></button>

    </div>
    <div class= "content" id="fragment-3">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    </div>
</div>
</html> 
  • 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-06-15T05:43:24+00:00Added an answer on June 15, 2026 at 5:43 am

    You’ve missed the most important part of the sample code 🙂

    $('#anim-shell').css({'position': 'absolute' });
    

    And just a friendly advice: do not query the same element twice, cache it instead (in your case it’s ‘#anim-shell’!

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

Sidebar

Related Questions

I found a topic on MSDN that talks that yes, this is possible. I
From what I've found with searches, Python seems incapable of this.. Is it possible
found this little code snippet that seems to do what i want, but im
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
Possible Duplicate: Can main function call itself in C++? I found this problem very
Found this Multimap containing pairs? , but it is not much help How would
found this regex: insert every 10 characters: $text = preg_replace(|(.{10})|u, \${1}. , $text); can
Found this rather strange bug in IE8; element.style.top is limited to 1342177 pixels. Even
Possible Duplicate: Reference - What does this symbol mean in PHP? Found an image
I have a text file that looks like this: STUFF UP HERE APEXED NUMBER

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.