View Single Post
  #1 (permalink)  
Old 03-12-2005, 04:25 AM
sn0rcha sn0rcha is offline
Registered User
 
Join Date: Mar 2005
Posts: 2
Question IE 6 Strange, strange problem

Hi gurus,

I'm writing a php/js function to build shrink and hide divs when you click on things;

here is the PHP;

//Show/Hide Function (builds +/- icon)
function sh($tid,$isshown,$txt)
{
if($isshown==1)
{
echo "<table width='100%' border='0' cellspacing='0' cellpadding='3'><tr><td align='left' valign='middle' id='upd$tid'><a href='javascript://' onClick=\"bupdd('upd$tid','1','$tid','$txt'); hide('$tid');\" title='Hide' tabindex='-1' class='sh'><img src='images/icons/tiny/minus.gif' border='0' id='img$tid'>&nbsp;$txt</a></td></tr></table>";
}
else
{
echo "<table width='100%' border='0' cellspacing='0' cellpadding='3'><tr><td align='left' valign='middle' id='upd$tid'><a href='javascript://' onClick=\"bupdd('upd$tid','0','$tid','$txt'); show('$tid');\" title='Show' tabindex='-1' class='sh'><img src='images/icons/tiny/plus.gif' border='0' id='img$tid'>&nbsp;$txt</a></td></tr></table>";
}
}

Here is the JS that it calls;
//Function to build the graphic for the up/down icon of the build table
function bupdd(the_div, the_state, table_div,txt)
{
if(the_state==0)
{
//alert('building hide div');
html="<a href='javascript://' onClick=\"clearIt('"+table_div+"'); bupdd('"+the_div+"','1','"+table_div+"','"+txt+"') ;\" title='Hide' class='sh'><img src='<?php echo $GLOBALS[site_url] ?>images/icons/tiny/minus.gif' border='0'>&nbsp;"+txt+"</a>";
document.all[the_div].innerHTML=html;
}
else
{
//alert('building show div');
document.all[the_div].innerHTML="<a href='javascript://' onClick=\"show('"+table_div+"'); bupdd('"+the_div+"','0','"+table_div+"','"+txt+"') ;\" title='Show' class='sh'><img src='<?php echo $GLOBALS[site_url] ?>images/icons/tiny/plus.gif' border='0'>&nbsp;"+txt+"</a>";
}
}

I also preload both those images;

Here is my problem;

IE 6.0 on my LAN development server the image swaps out no problem whether or not you click on the the text or the icon to shrink or hide (both inside same href)

IE 6.0 on my www publishing server, the icon only changes if you click on the icon to shrink or hide, not the text.

Firefox works no matter what you click on, regardless of domain.

I'm at a bit of a loss..... Is it that IE loads images differently then firefox when doing innerHTML calls or is it just that IE has some issues???

Any ideas?

Thanks
Sn0rcha

Last edited by sn0rcha; 03-12-2005 at 04:27 AM.
Reply With Quote