Skip to content

Instantly share code, notes, and snippets.

@rskull
Created September 7, 2011 12:00
Show Gist options
  • Save rskull/1200385 to your computer and use it in GitHub Desktop.
Save rskull/1200385 to your computer and use it in GitHub Desktop.
フェードさせるスクリプト
//IE非対応バージョンです。
function feedin (id, speed) {
//フェードさせたいところのID
var feed = document.getElementById(id);
var filter = 0;
//最初にフィルターを0に設定
feed.style.opacity = 0;
feed.style.MozOpacity = 0;
var timer = setInterval(function () {
//filter += 0.1 だとちゃんと計算されない
filter ++;
feed.style.opacity = (filter / 10);
feed.style.MozOpacity = (filter / 10);
if (filter == 10) {
clearInterval(timer);
}
},speed);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment