I currently have a image moving on a timer where a new image will appear but what I am trying to implement is a href URL
to the image so they can navigate the site.
So this is how I have set up the code.
The code for the image slider works perfectly fine which is
<script type="text/javascript">
$(function(){
//prepare Your data array with img urls
var dataArray=new Array(); <script type="text/javascript">
$(function(){
//prepare Your data array with img urls
var dataArray=new Array();
dataArray[0]="galleryevenbiggerbiggerversion.png";
dataArray[1]="galleryevenbiggeraboutversion.png";
dataArray[2]="galleryevenbiggereventsversion.png";
//start with id=0 after 5 seconds
var thisId=0;
window.setInterval(function(){
$('#thisImgcentral').attr('src',dataArray[thisId]);
thisId++; //increment data array id
if (thisId==3) thisId=0; //repeat from start
},7800);
});
</script>
So, I have tried to use this same concept but changed the src
to href
hoping for it to work but this is not working.
<script type="text/javascript">
$(function(){
//prepare Your data array with img urls
var dataArray=new Array();
dataArray[0]="index.php?page=Community";
dataArray[1]="index.php?page=About";
dataArray[2]="index.php?page=Events";
//start with id=0 after 5 seconds
var thisId4=0;
window.setInterval(function(){
$('#thisAddress').attr('href',dataArray[thisId4]);
thisId4++; //increment data array id
if (thisId4==3) thisId4=0; //repeat from start
},7800);
</script>
Finally, this is how I have laid out the html:
<a id=thisAddress href=index.php?page=Community><img class=headerimage id=thisImgcentral src=galleryevenbiggerbiggerversion.png></img></a></p>
Why would this be and how would it be possible to make this work?