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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:00:50+00:00 2026-05-28T08:00:50+00:00

Im trying to build an activty stream which automatically displays the the most recent

  • 0

Im trying to build an activty stream which automatically displays the the most recent entries into to a database table, updating every time a new row is entered.

At the moment it works by using Prototype’s Ajax.PeriodicalUpdater to constantly check for new entries and then display that to the user but it’s jumpy.

I would like to have any new entry found in the database slide in from the top using jQuery’s .slidedown animation.

here’s what I have at the moment

on the page with the activity stream:

<div id="activity"></div>

and the javascript:

Event.observe(window, 'load', function() {  
updater('activity', 'activities.php');
});

function updater(element_id, element_page)
{
  new Ajax.PeriodicalUpdater(element_id, element_page, {
   method: 'get', 
   frequency: 1, 
   decay: 2
  });
}

activities.php:

foreach($activities as $activity)
{
  // get time since created
  $created = strtotime($activity['Activity']['created']);
  $time_since = $this->Time->timeAgoInWords($created);
  ?>
   <div id="activity_item">
     <span id="type"><?php echo $activity['Activity']['type']?></span>
     <span id="created"><?php echo $time_since ?></span><br />
     <span id="event"><?php echo $activity['Activity']['event']?></span>
    </div>
  <?php
 }

Any ideas on how to then incorporate the slidedown animation? or am I doing this the wrong way altogether?

  • 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-28T08:00:50+00:00Added an answer on May 28, 2026 at 8:00 am

    You might have better luck using the jQuery periodical updater plugin, found here: https://github.com/RobertFischer/JQuery-PeriodicalUpdater/

    As an example, this will poll from /path/to/get/request and add a new entry to the top of a block with id #feed (which has a max length of 5 items).

    $.PeriodicalUpdater('/path/to/get/request', 
      {method: 'get', data: '', minTimeout: 10000, maxTimeout: 32000,
       multiplier: 2, type: 'json', maxCalls: 0, autoStop: 0},
     function(d, success, xhr, handle) { 
        $("#feed").prepend('<h3>'+d.something+'</h3>');
        $("#feed").children().first().css("display", "none");
        if ($("#feed").children().length > 5) {
            $("#feed").children().last().remove();
        }
        $("#feed").children().first().addClass("first")
            .next().removeClass("first");
        $("#feed").children().first().slideDown(200);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying build a method which returns the shortest path from one node to
Trying to build Xuggler under Windows. Xuggler is core native code functions wrapped into
I am trying to build an App which is swapping its fragments by interactions
I'm trying to build a simple Android app that increments a number displayed every
I'm trying to build a service which runs in the background and pops up
Hey i'm trying to build an app in which the user can input some
I'm trying to design a system which reports activity events to a database via
Hey guys I am trying to build a signature task application . In which
I'm trying to provide an in-app Activity which displays thumbnails of photos in the
I am trying to build an android app which utilizes the camera, but only

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.