Quote (nonNo @ Jan 13 2014 02:42am)
i'have try this solution too
ar=new Array(v,w,x,y,z);
har=new Array('v','w','x','y','z');
var i=0;
for (i=0;i<=har.length;i++){
$("#img"+har[i]).click(function(){
$("#Big").text("");
$("#Big").append(ar[i]);
});
}
it work's 90%...i mean that the problem is in the last command.
if i try to force ar[0] for example, it work's. If i try to write ar[i] it doesnt works...seems that the function doesnt see the [i] :S
really i dont know the reason....var i got global scope :S
really don't have too much experience with js, but it'd look something like this, not gonna verify syntax so probably will need edited
$array[] = 'urlone.jpg';
$array[] = 'urltwo.jpg';
$array[] = 'urlthree.jpg';
$(function(){
setInterval(Transitioner, 3000);
});
function Transitioner() {
$i++;
if($i > 2) $i = 0;
document.getElementById( 'slide1' ).style.display = 'none';
document.getElementById( 'slide2' ).style.display = 'none';
document.getElementById( 'slide3' ).style.display = 'none';
document.getElementById( 'slide' . $array[$i] ).style.display = 'inline';
}
too tired to add in the clicks, going to bed