nnoza
03-05-2008, 10:11 AM
I´ve got a problem right here! The problem is that I need to have multiple ID(elements) inside document.getElementById('') but this code won´t work. I found it on a similar website that uses exactly the same code as I´ve got here. The strange thing is that the code works on this site but won´t work at all on my!!???!? I am not so used to js so please help me anyone if possible.
As it is now the js code steers only the "nav1". So my question is how can I have multiple ID:s inside document.getElementById('')..? Is it possible at all?
Here is the link to the working site: http://mjijackson.com/shadowbox/ (Image Map)..
<script type="text/javascript">
window.onload = function(){
Shadowbox.init();
/**
* Note: The following command is not necessary in your own project. It is
* only used here to set up the demonstrations on this page.
*/
initDemos();
};
function initDemos(){
Shadowbox.setup([
document.getElementById('nav3'),
document.getElementById('nav4'),
document.getElementById('nav4')
], {
gallery: 'Flash',
continuous: true,
counterType: 'skip',
animSequence: 'sync'
});
Shadowbox.setup(document.getElementById('hongkongmap').getElementsByTagName('area'));
};
</script>
<img src="text3.png" width="730" height="238" alt="projects 1 & 2" usemap="#nav3">
<map id="nav3" name="nav3">
<area shape="rect" coords="30,11,241,143" href="blekingemenu.png" alt="Blekingemenu.com">
<area shape="rect" coords="260,11,471,143" href="admalish.png" alt="Admalish">
</map>
<img src="text4.png" width="730" height="238" alt="projects 3 & 4" usemap="#nav4">
<map id="nav4" name="nav4">
<area shape="rect" coords="30,11,241,143" href="wii_confess.png" alt="">
<area shape="rect" coords="260,11,471,143" href="admalish.png" alt="">
</map>
<img src="text5.png" width="730" height="238" alt="projects 5 & 6" usemap="#nav5">
<map id="nav5" name="nav5">
<area shape="rect" coords="30,11,241,143" href="blekingemenu.png" alt="">
<area shape="rect" coords="260,11,471,143" href="admalish.png" alt="">
</map>
As it is now the js code steers only the "nav1". So my question is how can I have multiple ID:s inside document.getElementById('')..? Is it possible at all?
Here is the link to the working site: http://mjijackson.com/shadowbox/ (Image Map)..
<script type="text/javascript">
window.onload = function(){
Shadowbox.init();
/**
* Note: The following command is not necessary in your own project. It is
* only used here to set up the demonstrations on this page.
*/
initDemos();
};
function initDemos(){
Shadowbox.setup([
document.getElementById('nav3'),
document.getElementById('nav4'),
document.getElementById('nav4')
], {
gallery: 'Flash',
continuous: true,
counterType: 'skip',
animSequence: 'sync'
});
Shadowbox.setup(document.getElementById('hongkongmap').getElementsByTagName('area'));
};
</script>
<img src="text3.png" width="730" height="238" alt="projects 1 & 2" usemap="#nav3">
<map id="nav3" name="nav3">
<area shape="rect" coords="30,11,241,143" href="blekingemenu.png" alt="Blekingemenu.com">
<area shape="rect" coords="260,11,471,143" href="admalish.png" alt="Admalish">
</map>
<img src="text4.png" width="730" height="238" alt="projects 3 & 4" usemap="#nav4">
<map id="nav4" name="nav4">
<area shape="rect" coords="30,11,241,143" href="wii_confess.png" alt="">
<area shape="rect" coords="260,11,471,143" href="admalish.png" alt="">
</map>
<img src="text5.png" width="730" height="238" alt="projects 5 & 6" usemap="#nav5">
<map id="nav5" name="nav5">
<area shape="rect" coords="30,11,241,143" href="blekingemenu.png" alt="">
<area shape="rect" coords="260,11,471,143" href="admalish.png" alt="">
</map>