Solved

animated divs or table rows

Posted on 2014-10-18
8
59 Views
Last Modified: 2014-11-27
Hi,

say for eg: If I have some HTML that has divs or rows. Is it possible to animate them so that they slide upward continuously at a defined speed?

What I want to do is post some announcements into a div and have them slide on the webpage for an animated effect.

Please help...
0
Comment
Question by:Techsavy
  • 4
  • 3
8 Comments
 
LVL 17

Expert Comment

by:selvol
Comment Utility
Of course.  Jquery as you may know offers this as an option.

http://api.jquery.com/animate/

You can always DL the UI and play with the code here.

http://jqueryui.com/download/

Selvol
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
0
 

Author Comment

by:Techsavy
Comment Utility
Hi Gary,

Your solution is very close but it is not very animated i.e it pauses and moves up but I am looking for more smooth and continuous moment. It needs to slow down a little bit.

Please help..
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Just wanted to know if that was what you were looking for
Will put something together

Whats your actual markup?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
There will be a slight pause as it restarts the cycle

http://jsfiddle.net/uw9Ltx1d/8/

rowHeight = $("ul li").outerHeight();

ticker = " ul li";

children = $("div ul li").length;

$("div").append($("div").html())

var scroller = function () {
    $("ul:first").animate({
        marginTop: "-" + (children * rowHeight) + "px"
    }, 5000, function () {
        $("ul:first").insertAfter($("ul:last")).css("margin-top", 0);
        scroller()
    })
}

scroller()

Open in new window

0
 

Author Comment

by:Techsavy
Comment Utility
Hi Gary,

This code is not working when I put it on a SharePoint page. basically there will be other divs and ul and li elements. we have to make it much more smarter
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Well you have to specify the class or ID of the UL - it won't work as it is if you just put in a page with other ul's in it.
0
 

Author Closing Comment

by:Techsavy
Comment Utility
Good solution!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now