javascript - How can I make my slideshow fade? -


im trying edit current javascript file make image slideshow fade each other rather jumping picture picture. here current code:

var myimage=document.getelementbyid("myphoto");  var imagearray=["workone.jpg", "worktwo.jpg", "workthree.jpg"]  var imageindex=0;  function changeimage () { myphoto.setattribute("src", imagearray [ imageindex]); imageindex++; if (imageindex>=imagearray.length) {     imageindex=0; } }  var intervalhandle = setinterval(changeimage,4000);  myphoto.onclick=function() { clearinterval(intervalhandle); }     

you can use jquery here. check fadein , fadeout functions. can achieve raw javascript changing element's opacity gradually.


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -