Hi Guys The below code does not work in Safari, seems fine in IE. The code should change the image border width when you click the link. <script type="text/javascript"> <!-- function MM_changeProp(objId,x,theProp,theValue) { //v9.0 var obj = null; with (document){ if (getElementById) obj = getElementById(objId); } if (obj){ if (theValue == true || theValue == false) eval("obj.style."+theProp+"="+theValue); else eval("obj.style."+theProp+"='"+theValue+"'"); } } //--> </script> </head> <body> <p onclick="MM_changeProp('img','','borderWidth','10','IMG')">Link</p> <p><img src="image1.gif" name="img" width="1" height="10" border="0" id="img" /></p> </body> </html> Can anyone see why it's not working in Safari? Thanks for your help. cigi
Hi cigi, I don't have Safari, so I cannot check. So I guess... Either Safari doesn't like "with" statement, so try it with document.getElementById(objId); ... and if no success, then another thing might be the eval! so try this syntax obj.style[theProp] = theValue; (of course without eval) Does something work??
Many thanks for your reply lp1051 I ditched that idea and used this instead: function changeIt(){ var width=1 var height=18 document.sizer.width=width document.sizer.height=height Onclick with text link. It just controls a transparent gif to move a div tag down once clicked. Works in Safari. cigi