Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime error with dhtml js

Status
Not open for further replies.

awesomebeats

Technical User
Nov 29, 2001
25
US
i'm using dreamweaver and i have a extension that makes the following code for a dhtml layer scroll thing, however, i get an error with line 26, a runtime error. it asks if i want to debug, if i hit refesh everything works. here's the code. the code in red it line 26 that's causing the error.

Code:
<script language=&quot;JavaScript&quot;>
<!--
function P7AniMagic(el, x, y, a, b, c, s) { //v2.8 PVII
 var g,elo=el,f=&quot;&quot;,m=false,d=&quot;&quot;;x=parseInt(x);y=parseInt(y);
 var t = 'g.p7Magic = setTimeout(&quot;P7AniMagic(\''+elo+'\','; 
 if ((g=MM_findObj(el))!=null) {d=(document.layers)?g:g.style;}else{return;}
 if (parseInt(s)>0) {eval(t+x+','+y+','+a+','+b+','+c+',0)&quot;,' + s+')');return;}
 var xx=(parseInt(d.left))?parseInt(d.left):0;
 var yy=(parseInt(d.top))?parseInt(d.top):0;
 if(parseInt(c)==1) {x+=xx;y+=yy;m=true;c=0;}
 else if (c==2) {m=false;clearTimeout(g.p7Magic);}
 else {var i=parseInt(a);
  if (eval(g.moved)){clearTimeout(g.p7Magic);}
  if (xx<x){xx+=i;m=true;if(xx>x){xx=x;}}
  if (xx>x){xx-=i;m=true;if(xx<x){xx=x;}}
  if (yy<y){yy+=i;m=true;if(yy>y){yy=y;}}
  if (yy>y){yy-=i;m=true;if(yy<y){yy=y;}}}
if (m){if((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf(&quot;MSIE&quot;)>-1)&&
Code:
<navigator.userAgent.indexOf(&quot;Opera&quot;)==-1){
    xx+=&quot;px&quot;;yy+=&quot;px&quot;;}
  d.left=xx;d.top=yy;g.moved=true;eval(t+x+','+y+','+a+','+b+','+c+',0)&quot;,'+b+')');
  }else {g.moved=false;}
}
//-->
</script>

any idea why this is happening and what it means
 
i got a headache trying to follow this code. but assuming your post it correct i'd try changing <navigator.userAgent.indexOf(&quot;Opera&quot;)==-1){ to (navigator.userAgent.indexOf(&quot;Opera&quot;)==-1){
 
yeah the code's a pain but that didn't work cause there already isn't an end ( for that so i had to add another one which was useless. no problem thanx for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top