scriptkonflikt og tabeller
Jeg har to scripts der er i konflikt med hinanden.De ser således ud:
<script type="text/javascript">
/****************************************************
* DOM Image rollover:
* by Chris Poole
* http://chrispoole.com
* Script featured on http://www.dynamicdrive.com
* Keep this notice intact to use it :-)
****************************************************/
function init() {
if (!document.getElementById) return
var imgOriginSrc;
var imgTemp = new Array();
var imgarr = document.getElementsByTagName('img');
for (var i = 0; i < imgarr.length; i++) {
if (imgarr[i].getAttribute('hsrc')) {
imgTemp[i] = new Image();
imgTemp[i].src = imgarr[i].getAttribute('hsrc');
imgarr[i].onmouseover = function() {
imgOriginSrc = this.getAttribute('src');
this.setAttribute('src',this.getAttribute('hsrc'))
}
imgarr[i].onmouseout = function() {
this.setAttribute('src',imgOriginSrc)
}
}
}
}
onload=init;
</script>
.............og:
<script>
<!--
/*
Textual Tooltip Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
var content=new Array()
//change the array below to the text associated with your links Expand or contract the array, depending on how many links you have
content[0]='<big><b>valg 1</b></big><br>bla bla bla '
content[1]='<big><b>valg 2</b></big><br>yada yada yada'
content[2]='<big><b>valg 3</b></big><br>tra la la la la'
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
appear()
setTimeout("window.onresize=regenerate",450)
}
}
function changetext(whichcontent){
if (document.all||document.getElementById){
cross_el=document.getElementById? document.getElementById("descriptions"):document.all.descriptions
cross_el.innerHTML='<font face="Tahoma"><small>'+whichcontent+'<font></small>'
}
else if (document.layers){
document.d1.document.d2.document.write('<font face="Tahoma"><small>'+whichcontent+'</small></font>')
document.d1.document.d2.document.close()
}
}
function appear(){
document.d1.visibility='show'
}
window.onload=regenerate2
//-->
</script>
Det sidste script skal egentlig KUN fungere i en af to tabeller på en side.
Mit spørgsmål er så:
Kan jeg definere at det ene script KUN skal gælde for en del af siden, og i så fald, hvordan?
ELLER... er der en anden løsning på problemet?
/bbblow