开发者

how do i have a facebook-like scrolling updates on my website showing all activity

i have an asp.net mvc website with a SQL server backend.

For every table i have a "History" table to track all changes (who, when, etc). I can run a query and generate an audit report (view o开发者_Python百科f what has changed including who, when, etc) but i wanted to try to implement a facebook style view that shows a list of updates (instead of a static report) that updates . . .

what is the best way to get started on implementing something like this in asp.net mvc?

do i just have some jquery get called on a timer from the client side? Is there any code to leverage instead of having to write this from scratch?


yes its pretty easy with jquery if you dont need the facebook dropdown effect when something new appeards

to load stuff in jquery you just have to do something like this

$('myupdatelist').load('getupdatelist.php?x=y')

combine this with setInterval

setInterval( function() { $('myupdatelist').load('getupdatelist.php?x=y') } , 1000 )

to update this list every second if you want a fadeIn fadeOut effect on each update try this

setInterval( function() { $('myupdatelist').fadeOut("slow").load('getupdatelist.php?x=y', $('myupdatelist').fadeIn("slow")) } , 1000 )

if you want other kinds of animations you should look into the jquery ui: http://jqueryui.com/docs/effect/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜