Jump to content

Matej

Members
  • Posts

    185
  • Joined

  • Last visited

Posts posted by Matej

  1. hi.

    Whats the diffrence between setTimeout and setInterval?

     

    I mean , when i want to make slideshow setTimeout works but Setinverval doesnt , but both of them should work for that.

  2. Just for info , while loop doesnt make what for in term of chaning speed right?

     

    for example

     

    function swapImage() { var i=0;document.slide.src = path[i]; while(i < path.length -1 ){ i++;} ;if(i>path.length) {i = 0;} ; setTimeout("swapImage()",3000); } window.onload=swapImage; 

    dont work >{

  3. Hello ,

     

    <img id="matej" src="http://thegraphicsfairy.com/wp-content/uploads/blogger/-72LEqJJmnH0/TtoypcjmR8I/AAAAAAAAPjA/3AbGm3448JU/s1600/alarm%2Bclock%2Bsmall%2Bvintage%2Bimage%2Bgraphicsfairy2.jpg" width=100px; height="50px"> <script>var lol=new Array();lol[0]="https://guardian-registration.s3.amazonaws.com/networks/network/illustration/Illustration-small_business.png"lol[1]="http://peach.blender.org/wp-content/uploads/poster_rodents_small.jpg";lol[2]="http://upload.wikimedia.org/wikipedia/en/8/85/Small_soldiers_movie_poster.jpg";function torko(){ for(i=0;i<lol.length;i++){var x=document.getElementById("matej");x.src=lol[i];}setTimeout("torko()",3000);  } window.onload=torko;</script> 

     

    why isnt my for loop working? (it does not slide the image) ; also if i use

     

    if(i<lol.length-1){i++}else{i=0}

    it works , can someone explain why please?

  4. <div id="ahoj"></div><div id="lol"></div><div id="cai"></div><button id="matek"> cau </button>   function sg(){x=document.getElementById("cai");g=x.style.display;if(g=="none"){g=="block"}else{g=="none"};} window.onload=zmena;function zmena(){    document.getElementById("matek").onclick=sg;}

    i have set #cai{display:none;}

    Can you tell me whats wrong with my script and why it isnt workign? (its writting only error nothing more)// on the different IDE it writtes"none is not defined

  5. Hello!

    i'd like to ask about this script

     

    function farba(newcol) {    this.style.color = newcol;}function ahoj() {    var sup = document.getElementById('aaa');    farba.call(sup,'blue'); if(sup.style.color == "blue"){sup.style.color="red"}else{sup.style.color="blue"}

     

    what should i change there for it , to work please?:)

×
×
  • Create New...