﻿$(function () { $("#page-scroll").scrollable({ next: ".next-page", prev: ".prev-page", disabledClass: "nav-page-disabled" }); var api = $("#page-scroll").data("scrollable"); api.onBeforeSeek(function (event, i) { if (i == 0) { $(".browse").hide() } else { $(".browse").fadeIn(300) } }); $("a.btn-home").click(function (e) { api.seekTo(0) }); $("a.btn-start, #btn-next-hint").click(function (e) { api.seekTo(1) }); $("a.btn-start").hover(function () { $("#btn-next-hint").stop(true, true).fadeIn(1200) }, function () { $("#btn-next-hint").stop(true, true).fadeOut(300) }); var html = ""; var tweeturl = "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=dmcnetau&include_rts=true&count=5&callback=?"; $.getJSON(tweeturl, function (d) { $.each(d, function (i, item) { t = item.text; t = t.replace(/http:\/\/\S+/g, '<a href="$&" target="_blank">$&</a>'); t = t.replace(/\s(@)(\w+)/g, ' @<a href="http://twitter.com/$2" target="_blank">$2</a>'); t = t.replace(/\s(#)(\w+)/g, ' #<a href="http://search.twitter.com/search?q=%23$2" target="_blank">$2</a>'); html += "<article class='sprite' >" + t + "</article>" }); $("#tweets").html(html); initTweets() }) }); function initTweets() { $("#twitter-feed").scrollable({ vertical: true, next: ".next-tweet", prev: ".prev-tweet", disabledClass: "nav-tweet-disabled" }) };
