+ 3
This is my two pictures I want when one pic will be hidden second will show but my setinterval don't working why
$(function(){ setInterval(function(){ $('#one').hide(); $('#one1').show() },1000) })//
12 odpowiedzi
+ 6
var tmp = false;
function(){
function Toggle(){
if(tmp){
$("#one").hide();
$("#one1").show();
}else {
$("#one1").hide();
$("#one").show();
}
tmp = !tmp;
}
setInterval(Toggle,1000);
}
+ 3
its your mistake not setInterval ()
this code will always hide the image with one id.
+ 3
$("one").hide()
will always hide image with id one
$("one1"). show ()
will always show image with id one1
wait let me code what you want...
+ 3
function(){
function Toggle(){
$("#one").fadetoggle();
$("#one1"). fadetoggle();
}
setInterval(Toggle,1000);
}
+ 3
@rose fade toggle will not give you the result
+ 1
Yeah but I want to everyseconde be hide and show
+ 1
you can also try to use .fadetoggle()
method on just one element instead,if your both elements on same place and with same size.
+ 1
how
+ 1
ok guys I will try tomorrow and say u
0
why
- 1
yep,like this :D but I guess we can fadetoggle just higher element :)
- 1
Yeah...guess it will be weird since it will increase opacity and then will go back...
Just thought how it will work sorry :D