用于Twitter的Element Autoscroll

时间:2015-11-06 21:34:05

标签: jquery twitter autoscroll

我试图执行以下操作:

我有一个像我这样播放我的推特时间线的网页

Twitter without Scroll

我想要做的是添加一个滚动到时间轴底部然后再次上升的自动滚动。

我能够获得以下代码以在页面上滚动而不是元素。



<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">

<title>Twitter Feed</title>

<style>
html{
	overflow:hidden !important;
}
body{
	background-color:#333;
}
#container{
	width:350px;
}
div.timeline div.stream{
	overflow:hidden !important;
	overflow-x:hidden !important;
	overflow-y:hidden !important;
}
div.twtr-doc{
	margin-top: 37px;
}
</style>
<script src="jsFiles/jquery-1.7.js"></script>
</head>

<body>

<script>
function scroll(speed) {
    $('html, body').animate({ scrollTop: $(document).height() - $(window).height() }, speed, function() {
        $(this).animate({ scrollTop: 0 }, speed);
    });
}

speed = 1000;

scroll(speed)
setInterval(function(){scroll(speed)}, speed * 1);
</script>


<div id="container">
    <a class="twitter-timeline" href="https://twitter.com/wildenmediainc" data-widget-id="539490745749475328" data-chrome="noscrollbar nofooter" width="350px;">Tweets by @wildenmediainc		</a>
	<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>

</body>

</html>
&#13;
&#13;
&#13;

结果在这里Twitter with Scroll

现在这不是我真正想要的。我想要的是让滚动在Twitter时间线内发生。请帮助我到那儿。

我不是编码员,但在你的帮助下,我可以做到这一点

谢谢, 侯赛因

0 个答案:

没有答案