473,412 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Javascript doesnt work in Firefox

Hi I am updating some pages from a website that is a few years old and
I didnt work on the site then, but the javascript works in ie but not
in firefox. The scripting is

function yyLayerScroll(daTarget, delay, ex, ey, dx, dy, sx, sy, daT,
daLoop, daFirst ) {
var yyX; var yyY; var target = MM_findObj(daTarget);
if(!target.oritop){
target.oritop = (document.layers)?target.top:target.style.top;
target.orileft = (document.layers)?target.left:target.style.left
}
if (document.layers) {
var ct = target.clip.top; var cb = target.clip.bottom; var cl =
target.clip.left; var cr = target.clip.right;
yyY=Math.abs(Math.round((ct-ey)/sy)); dy=Math.round(-(ct-ey)/yyY);
yyX=Math.abs(Math.round((cl-ex)/sx)); dx=Math.round(-(cl-ex)/yyX);
if(yyX<1){dx=0}else{yyX--}; if(yyY<1){dy=0}else{yyY--};
var t = target.top; var l = target.left;
target.clip.top = ct + (dy); target.clip.bottom = cb +
(dy);target.top = t - (dy);
target.clip.left = cl + dx;target.clip.right = cr + dx; target.left
= l - dx;
}else if ((document.all||document.getElementById)&&target.s tyle.clip)
{
var l =
parseInt((document.getElementById)?target.style.le ft:target.style.pixelLeft);
var t =
parseInt((document.getElementById)?target.style.to p:target.style.pixelTop);
var clipv = target.style.clip;
clipv=clipv.replace(/x/gi, "").replace(/t/gi, "");
clipv=clipv.split("rec(")[1].split(")")[0].split("p");
var ct = Number(clipv[0]);var cr = Number(clipv[1]);var cb =
Number(clipv[2]);var cl = Number(clipv[3]);
yyY=Math.abs(Math.round((ct-ey)/sy));dy=Math.round(-(ct-ey)/yyY);
yyX=Math.abs(Math.round((cl-ex)/sx));dx=Math.round(-(cl-ex)/yyX);
if(yyX<1)dx=0; if(yyY<1)dy=0;
ncl = cl + dx; nct = ct + dy; ncr = cr + dx; ncb = cb + dy;
target.style.pixelTop = t - dy;
target.style.pixelLeft = l - dx;
target.style.left = l - dx;
target.style.top = t - dy;
eval("target.style.clip = 'rect(' + nct + ' ' + ncr + ' ' + ncb
+ ' ' + ncl +')'");
yyY--; yyX--;
}
if(target.tmtScrollo)clearTimeout(target.tmtScroll o);
if(yyY>0||yyX>0){
var doTo = true;
}else if(delay>-1&&daLoop==true){
if(document.layers){
target.left = target.orileft; target.clip.left=0;
target.clip.right = (cr-cl); target.top = target.oritop;
target.clip.top=0; target.clip.bottom = (cb-ct);
}else{
eval("target.style.clip = 'rect(' + 0 + ' ' + (cr-cl) + ' ' +
(cb-ct) + ' ' +0 +')'");
target.style.top = target.oritop; target.style.left =
target.orileft;
}
var doTo = true;
}
if(doTo==true)target.tmtScrollo = setTimeout("yyLayerScroll(\"" +
daTarget + "\"," + delay + "," + ex+ "," + ey+ "," + dx+ "," + dy +
"," +sx + "," + sy + "," + false +","+daLoop + ")", delay);
}

function YY_LS(daTarget, yy_x,yy_y, delay, step, loop){
if(document.layers||document.all||document.getElem entById)
yyLayerScroll(daTarget,delay, yy_x, yy_y, 0, 0,step,step, false,
loop, true);
}
function YY_StopLayerfx(){
var args = YY_StopLayerfx.arguments;var yydiv;
for (var i=0; i<args.length; i++){
yydiv=MM_findObj(args[i]);
if
(yydiv&&(document.layers||document.all||document.g etElementById)){
if(yydiv.yyto!=null)clearTimeout(yydiv.yyto);
if(yydiv.tmtScrollo!=null)clearTimeout(yydiv.tmtSc rollo);
}
}
}

then is called like this

<a class=links
href="javascript:;" onMouseOut="YY_StopLayerfx('a2')"
onMouseOver="YY_LS('a2','128','0',50,7,false)"><im g
src="../images/right.gif" border="0" width="11" height="20"></a>

Anyone know what is causing it not to work and how can you fix it.

Randy

Dec 14 '06 #1
1 1878
"Rabel" <Ra***@Creativeness.comwrote in news:1166129843.425639.90730
@j72g2000cwa.googlegroups.com:
I am updating some pages from a website that is a few years old and
I didnt work on the site then, but the javascript works in ie but not
in firefox.
Firefox has excellent javascript debugging capabilities provided, for
example, by extensions such as Console2 or Venkman. That way, you can see
for yourself why your javascript doesn't work the way you expect it would,
or wish it would.
Dec 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: nec | last post by:
Hi, I'm having trouble calling a function thats located in a iFrame from the parent. Shortly, i can't figure out the location in DOM. In IE it works fine with a simple line of...
1
by: Rose Girl | last post by:
I have a web application that uses xsl and javascript which runs smoothly on IE. Recently i decided to try it on FireFox 1.0 . But the same application gives javascript errors as displayed in the...
4
by: simon.cigoj | last post by:
I have an javascript made menu and some forms with the dropdown element. When the menu opens and scrolls down the drop down is displeyed over the menu and obscures the menu choices. I have this...
4
by: Paul Fi | last post by:
im trying to change the width of an object dynamically, this i s the object inside an html form input name="btnEmpty" id = "btnempty" type="button" class="" value=""
3
by: 9DeT | last post by:
The javascript works perfect on IE, but on firefox it doesnt. I've pasted both frames source, as well as the page source ( the right frame source.txt was zipped to fit the maximum size allowed)...
1
by: ryezack | last post by:
i have an image map with an onmouseover event thats calls a javascript function style cursor is hand. this works in IE but not in firefox. here's the code: <script type="text/javascript"> <!--...
3
by: neoseeker191 | last post by:
It works fine in Firefox 2+ but in IE7 the alert window doesnt appear and the script doesnt work. Maybe I'm missing something Heres the form the script is tied to: <form id="Quiz"...
20
by: Hush | last post by:
Hi, The following code works fine in IE7 but FF returns with an error: Access denied to achieve the property Element.firstChild. In this line: nodes = xmlDoc.documentElement.childNodes; My...
2
by: ManidipSengupta | last post by:
Hi, a few (3) questions for the Java experts, and let me know if this is the right forum. It deals with 100% java code (reason for posting here) but manages a Web browser with Javascript. Thanks in...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.