Skip to content

Instantly share code, notes, and snippets.

@timruffles
Created May 25, 2011 16:26
Show Gist options
  • Save timruffles/991295 to your computer and use it in GitHub Desktop.
Save timruffles/991295 to your computer and use it in GitHub Desktop.
for parks
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<h3 class="title">Picklive buzz</h3>
<script type="text/javascript">
var rotater = function(selector) {
var item, lastItem;
return function() {
if(!this.list) this.list = $(selector);
if(!this.index) this.index = 0;
lastItem = item;
item = this.list.eq(this.index);
this.index++;
if(this.index == this.list.length) this.index = 0;
return [item,lastItem];
}
},
effectRotater = function(selector,effectFn) {
var plainRotater = this.rotater(selector);
return function() {
var itemLast = plainRotater();
effectFn(itemLast[0],itemLast[1])
}
},
effectFn = function(newEle,oldEle) {
// your code goes here
$(newEle).slideDown()
$(oldEle).slideUp()
};
setInterval(effectRotater('.aaa',effectFn),2000)
</script>
<div class="aaa">
<blockquote>
“It’s certainly going to make every game a bit more interesting”
</blockquote>
<img src="/images/logo_stuff_black.gif">
</div>
<div class="aaa">
<blockquote>
“A whole new realm of entertainment”
</blockquote>
<img src="/images/logo_bbc_black.gif">
</div>
<div class="aaa">
<blockquote>
“Picklive will even add spice to a no score draw”
</blockquote>
<img src="/images/logo_yahoo_black.gif">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment