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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -