Skip to navigation
How to simple imageblend with javasdcript
07.12.13
function opacity(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } function shiftOpacity(id, millisec) { //if an element is invisible, make it visible, else make it ivisible if(document.getElementById(id).style.opacity == 0) { opacity(id, 0, 100, millisec); } else { opacity(id, 100, 0, millisec); } } function hideimages(){ document.getElementById('img1').style.opacity = 0; document.getElementById('img2').style.opacity = 0; document.getElementById('img3').style.opacity = 0; document.getElementById('img4').style.opacity = 0; document.getElementById('img5').style.opacity = 0; document.getElementById('img6').style.opacity = 0; showimages(); timedCount(); } function showimages(){ document.getElementById('img1').style.visibility = "visible"; document.getElementById('img2').style.visibility = "visible"; document.getElementById('img3').style.visibility = "visible"; document.getElementById('img4').style.visibility = "visible"; document.getElementById('img5').style.visibility = "visible"; document.getElementById('img6').style.visibility = "visible"; } var c=0; var t; function timedCount() { c=c+1; t=setTimeout("timedCount()",1000); if (c==5){ shiftOpacity('img1', 1000) } if (c==10){ shiftOpacity('img1', 1000) } if (c==10){ shiftOpacity('img2', 1000) } if (c==15){ shiftOpacity('img2', 1000) } if (c==15){ shiftOpacity('img3', 1000) } if (c==20){ shiftOpacity('img3', 1000) } if (c==20){ shiftOpacity('img4', 1000) } if (c==25){ shiftOpacity('img4', 1000) } if (c==25){ shiftOpacity('img5', 1000) } if (c==30){ shiftOpacity('img5', 1000) } if (c==30){ shiftOpacity('img6', 1000) } if (c==35){ shiftOpacity('img6', 1000) } }
Reply
Anonymous
how to simple imageblend with javasdcript
function opacity(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } function shiftOpacity(id, millisec) { //if an element is invisible, make it visible, else make it ivisible if(document.getElementById(id).style.opacity == 0) { opacity(id, 0, 100, millisec); } else { opacity(id, 100, 0, millisec); } } function hideimages(){ document.getElementById('img1').style.opacity = 0; document.getElementById('img2').style.opacity = 0; document.getElementById('img3').style.opacity = 0; document.getElementById('img4').style.opacity = 0; document.getElementById('img5').style.opacity = 0; document.getElementById('img6').style.opacity = 0; showimages(); timedCount(); } function showimages(){ document.getElementById('img1').style.visibility = "visible"; document.getElementById('img2').style.visibility = "visible"; document.getElementById('img3').style.visibility = "visible"; document.getElementById('img4').style.visibility = "visible"; document.getElementById('img5').style.visibility = "visible"; document.getElementById('img6').style.visibility = "visible"; } var c=0; var t; function timedCount() { c=c+1; t=setTimeout("timedCount()",1000); if (c==5){ shiftOpacity('img1', 1000) } if (c==10){ shiftOpacity('img1', 1000) } if (c==10){ shiftOpacity('img2', 1000) } if (c==15){ shiftOpacity('img2', 1000) } if (c==15){ shiftOpacity('img3', 1000) } if (c==20){ shiftOpacity('img3', 1000) } if (c==20){ shiftOpacity('img4', 1000) } if (c==25){ shiftOpacity('img4', 1000) } if (c==25){ shiftOpacity('img5', 1000) } if (c==30){ shiftOpacity('img5', 1000) } if (c==30){ shiftOpacity('img6', 1000) } if (c==35){ shiftOpacity('img6', 1000) } }
07.12.13
Reply
Anonymous
Information Epoch 1732383268
There is no perfect productivity system.
Home
Notebook
Contact us