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 7777967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:16:34+00:00 2026-06-01T18:16:34+00:00

I’ll get a table via AJAX aka jQuery.getJSON depended on the data are before

  • 0

I’ll get a table via AJAX aka jQuery.getJSON depended on the data are before or after the table should slide to right or to left. I’m an absolut beginner with jQuery. Normaly I would do that with normal javascript but I want to lern jQuery.

For getting the two tables slided I tried the code from this answer and I tried also this one.

But that all doesn’t slide. Not sure why.

My next try was to apply float:left to the first table and set the width but in that special case I got some trouble with the padding or margin. Maybe something related with the template I’m using.

However how can I manage to slide new content into a table from right to left and vice vesa?


  <div class="content">
    <script type="text/javascript">
function load(url) {
    document.body.style.cursor='wait';
    jQuery.getJSON(url, function(data) {
        document.body.style.cursor='default';
        var html = "";
        var yes=0;
        for(var i=0;i<data['data'].length;i++)
            if(data['data'][i].state)
                yes++;

        var nav=document.getElementsByClassName('quick-nav')[0].getElementsByTagName('a');
        nav[0].href=data['navi']['last'];
        nav[1].href=data['navi']['next'];

        html+='<table class="Status" cellspacing="0">';
        html+='<tr><th style="width:120px;">Name</th><th style="width:120px;">Vorname</th><th>zugesagt</th><th style="width:100px;">&nbsp;</th></tr>';

        for(var i=0;i<data['data'].length;i++) {
            var user=data['data'][i];
            var status=user.state?"ja":"nein";
            html+='<tr class="'+(user.default?'':'un')+'regel"><td>'+user.lastname+'</td><td>'+user.firstname+'</td><td><img src="/images/'+status+'.png" alt="" title="'+status+'"/>'+status+'</td><td class="'+status+'">&nbsp;</td></tr>';
        }

        html+='</table>';

        document.getElementsByClassName('teilnahme-liste')[0].innerHTML+=html;
    });
}
</script>
<div class="quick-nav">
  <a href="/path/10.04.2012" onclick="load(this.href); return false;">&laquo; Woche früher</a>
  <a href="/path/24.04.2012" onclick="load(this.href); return false;" style="float:right;">Woche später &raquo;</a>
</div>
<div class="teilnahme-liste">
    <h2>...</h2>
  <style type="text/css">
.Status img {
    line-height: 1em;
    margin: -4px 0.4em 0 0;
    vertical-align: middle;
}
</style>
  <table class="Status" cellspacing="0">
    <tr>
      <th style="width:120px;">Name</th>
      <th style="width:120px;">Vorname</th>
      <th>zugesagt</th>
      <th style="width:100px;">&nbsp;</th>
    </tr>
    <tr class="regel">
      <td>Mustermann</td>
      <td>Max</td>
      <td><img src="/images/ja.png" alt="" title="ja"/>ja</td>
      <td class="ja">&nbsp;</td>
    </tr>
    <tr class="regel">
      <td>Müller</td>
      <td>Lieschen</td>
      <td><img src="/images/nein.png" alt="" title="nein"/>nein</td>
      <td class="nein">&nbsp;</td>
    </tr>
    <tr class="unregel">
      <td>Schmitt</td>
      <td>Tobias</td>
      <td><img src="/images/ja.png" alt="" title="ja"/>ja</td>
      <td class="ja">&nbsp;</td>
    </tr>
  </table>
</div><input type="submit" name="op" value="Speichern" class="form-submit" />  </div>
</div>
  </div>

    </div></div>
  • 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-01T18:16:36+00:00Added an answer on June 1, 2026 at 6:16 pm

    Here is my solution. Please note that I use the german words neu=new and alt=old:

    var neu=jQuery(jQuery(".Status")[1]);
    var alt=jQuery(jQuery(".Status")[0]);
    alt.css({ opacity: 1, left: '0px'});
    neu.css({ opacity: 1, left: '700px'});
    // move the element higher
    neu.css("margin-top",(alt[0].offsetTop-neu[0].offsetTop)+"px");
    
    neu.animate({ opacity: 1, left: '0px' }, 400);
    alt.animate({ opacity: 0, left: '700px' }, 400, null, function(){
        alt.remove();
        neu.css("margin-top","");
    });
    

    I also added this line css:

    .Status {
        position:relative;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to construct a data frame in an Rcpp function, but when I
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have some data like this: 1 2 3 4 5 9 2 6
I want to count how many characters a certain string has in PHP, but

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.