Created
September 7, 2011 12:00
-
-
Save rskull/1200385 to your computer and use it in GitHub Desktop.
フェードさせるスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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