Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
JavaScript in FireFox problem
Old 12-27-2007, 03:00 PM JavaScript in FireFox problem
kline11's Avatar
SearchBliss Web Tools

Posts: 1,728
Name: John
Location: USA
Trades: 0
I have this slide-in menu code and it worls great in IE but doesn't function in FireFox. Can anyone help?

Here is the entire html page code with just the example menu. Thanks!

Code:
<html>
<head>
<title>SearchBliss - Slide Menu Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript">
<!--

keyFrame = 0;

keyFrameBack = 0;

movingObjLeft = new Array(1);
movingObjTop = new Array(1);
movingObjLeftBack = new Array(1);
movingObjTopBack = new Array(1);

movingObjLeft[0] = new Array(-175,-160,-140,-120,-100,-80,-60,-40,-20,0);
movingObjTop[0] = new Array(0,0,0,0,0,0,0,0,0,0);
movingObjLeftBack[0] = new Array(0,-20,-40,-60,-80,-100,-120,-140,-160,-175);
movingObjTopBack[0] = new  Array(0,0,0,0,0,0,0,0,0,0);

function startSlide() 
{
     setTimeout("slideTheObject()", 50);
keyFrameBack = 0;
}


function startSlideBack() 
{
     setTimeout("slideTheObjectBack()",50)
keyFrame = 0;
}

function slideTheObject()  
{
     var whichOne;

      whichOne = document.all.menu.style;
      whichOne.posLeft = movingObjLeft[0][keyFrame];
      whichOne.posTop = movingObjTop[0][keyFrame];

     keyFrame++;

    if  (keyFrame < movingObjLeft[0].length && keyFrame < movingObjTop[0].length) 
         setTimeout("slideTheObject()",50);

}

function slideTheObjectBack()  
{
     var whichOne;

     whichOne = document.all.menu.style;
     whichOne.posLeft = movingObjLeftBack[0][keyFrameBack];
     whichOne.posTop = movingObjTopBack[0][keyFrameBack];

     keyFrameBack++
     if  (keyFrameBack < movingObjLeftBack[0].length && keyFrameBack < movingObjTopBack[0].length) 
          setTimeout("slideTheObjectBack()",50);

}
//-->
</script>
</head>

<body bgcolor="#FFFFFF"> 

<div id="menu" style="position:absolute;left:-175px;top:0px;width:200px;z-index:1"> 
<table width="200" border="1" cellspacing="0" cellpadding="3" bordercolor="#009900">
<tr align="left" valign="top"> 
<td bgcolor="#FFFFFF" style="font-weight:bold;font-family:Verdana;font-size:12px;" width="175"><a href="/Webmaster-Tools.htm" target="_blank">Free Web Tools</a><br>
				<a href="http://www.searchbliss.com/Free-Website-Content.htm">Free Website Content</a><br>
				<a href="http://www.searchbliss.com/webmaster_resources.htm">Free Resources</a><br>
				<a href="http://www.searchbliss.com/generators.asp">Buy Code Generators</a><br>
				<a href="http://www.searchbliss.com/affiliates.asp">Affiliate Program</a><br>
				<a href="http://www.searchbliss.com/free-toolbar.htm">Free Toolbar</a><br>
				<a href="http://www.searchbliss.com/dance.asp">Free Google Dance Tool</a><br>
				<a href="http://www.searchbliss.com/free-screen-savers.htm">Free Screensavers</a><br>
				<a href="http://www.searchbliss.com/webmaster-tools.htm">Web Tools</a><br>
				<a href="http://www.searchbliss.com/tell_a_friend.asp">Tell a Friend</a><br>
				<a href="http://www.searchbliss.com/Webmaster-Resources-Site-Map.htm">Site Map</a><br>
</td>
			<td bgcolor="#FFFFFF" style="font-weight:bold;font-family:Verdana;font-size:12;color:#009900;" align="center" width="20"> <a title="Open menu" href="javascript:startSlide();" style="text-decoration:none;"><b>&gt;</b></a><br>
				<a title="Close menu" href="javascript:startSlideBack();" style="text-decoration:none;"><b>&lt;</b></a><br>
				<br>
				M<br>
				E<br>
				N<br>U<br>
				<br>
				O<br>
				P<br>
				T<br>
				I<br>
				O<br>N<br>S</td>
</tr>
</table>
</div>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is online now
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-27-2007, 03:35 PM Re: JavaScript in FireFox problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
posLeft is NOT a standard W3c DOM style attribute, it is a MS only attribute (IE4.0 onwards)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-27-2007, 04:27 PM Re: JavaScript in FireFox problem
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Crossbrowser version;

Code:
<script type="text/javascript">
keyFrame = 0;

keyFrameBack = 0;

movingObjLeft = new Array(1);
movingObjTop = new Array(1);
movingObjLeftBack = new Array(1);
movingObjTopBack = new Array(1);

movingObjLeft[0] = new Array(-175,-160,-140,-120,-100,-80,-60,-40,-20,0);
movingObjTop[0] = new Array(0,0,0,0,0,0,0,0,0,0);
movingObjLeftBack[0] = new Array(0,-20,-40,-60,-80,-100,-120,-140,-160,-175);
movingObjTopBack[0] = new  Array(0,0,0,0,0,0,0,0,0,0);

function startSlide() 
{
     setTimeout("slideTheObject()", 50);
keyFrameBack = 0;
}


function startSlideBack() 
{
     setTimeout("slideTheObjectBack()",50)
keyFrame = 0;
}

function slideTheObject()  
{
     var whichOne;

     whichOne = document.getElementById("menu").style;
      whichOne.left = movingObjLeft[0][keyFrame]+"px";
      whichOne.top = movingObjTop[0][keyFrame]+"px";

     keyFrame++;

    if  (keyFrame < movingObjLeft[0].length && keyFrame < movingObjTop[0].length) 
         setTimeout("slideTheObject()",50);

}

function slideTheObjectBack()  
{
     var whichOne;

     whichOne = document.getElementById("menu").style;
     whichOne.left = movingObjLeftBack[0][keyFrameBack]+"px";
     whichOne.top = movingObjTopBack[0][keyFrameBack]+"px";

     keyFrameBack++
     if  (keyFrameBack < movingObjLeftBack[0].length && keyFrameBack < movingObjTopBack[0].length) 
          setTimeout("slideTheObjectBack()",50);

}
</script>
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-28-2007, 03:06 PM Re: JavaScript in FireFox problem
kline11's Avatar
SearchBliss Web Tools

Posts: 1,728
Name: John
Location: USA
Trades: 0
Thanks Chris! You're a huge help!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is online now
Reply With Quote
View Public Profile
 
Old 12-28-2007, 04:01 PM Re: JavaScript in FireFox problem
kline11's Avatar
SearchBliss Web Tools

Posts: 1,728
Name: John
Location: USA
Trades: 0
Hey Chris,
Maybe you can help me with this one. I know "MARQUEE" only works in IE and I beleive "innerHTML" only does as well. Is there an equivalent that can be used with this script? Can I get the same effect with a new version?:

Code:
<html>
<head>
<title>SearchBliss: Slide Link Drop Menu Example</title>
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr bgcolor="#FFFFFF" valign="bottom" align="left"> 
<td> <font face="Verdana" size="2">Menu: </font> 
<select name="s" onChange="MM_changeProp('Layer1','','innerHTML','&lt;MARQUEE SCROLLAMOUNT=120 behavior=slide direction=left&gt;&lt;a href=\&quot;\'+document.all.s.value+\'\&quot; target=\&quot;_blank\&quot; style=\&quot;color:#FF0000;font-family:Verdana;font-size:12px;\&quot;&gt;\'+document.all.s.value+\'&lt;/a&gt;&lt;/MARQUEE&gt;','DIV')" style="color:#FF0000;background-color:#CCCCCC;font-family:Verdana;font-size:12px;">
<option selected>- Select One -</option>
<option value="http://www.searchbliss.com/Webmaster-Tools.htm">Webmaster Tools</option>
<option value="http://www.searchbliss.com/Free-Website-Content.htm">Free Website Content</option>
<option value="http://www.searchbliss.com/generators.asp">Buy Tools</option>
</select>
<div id="Layer1" style="position:absolute; z-index:1; visibility: visible; width: 700px"></div>
</td>
</tr>
</table>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is online now
Reply With Quote
View Public Profile
 
Old 12-28-2007, 04:18 PM Re: JavaScript in FireFox problem
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
kline: I don't know if this is an exact match for what you want, but I've got a "ticker tape" version of something that I worked on for Hockey Hype that you're welcome to lift.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 12-29-2007, 03:45 PM Re: JavaScript in FireFox problem
kline11's Avatar
SearchBliss Web Tools

Posts: 1,728
Name: John
Location: USA
Trades: 0
Thanks Adam, I'll take a look.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is online now
Reply With Quote
View Public Profile
 
Old 12-31-2007, 03:45 PM Re: JavaScript in FireFox problem
kline11's Avatar
SearchBliss Web Tools

Posts: 1,728
Name: John
Location: USA
Trades: 0
Quote:
Originally Posted by ADAM Web Design View Post
kline: I don't know if this is an exact match for what you want, but I've got a "ticker tape" version of something that I worked on for Hockey Hype that you're welcome to lift.
Thanks again Adam, but isn't what I need (cool though). If you look at the code in IE, you'll see what I'm trying to do in FireFox as well.
Code:
<html>
<head>
<title>SearchBliss: Slide Link Drop Menu Example</title>
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr bgcolor="#FFFFFF" valign="bottom" align="left"> 
<td> <font face="Verdana" size="2">Menu: </font> 
<select name="s" onChange="MM_changeProp('Layer1','','innerHTML','&lt;MARQUEE SCROLLAMOUNT=120 behavior=slide direction=left&gt;&lt;a href=\&quot;\'+document.all.s.value+\'\&quot; target=\&quot;_blank\&quot; style=\&quot;color:#FF0000;font-family:Verdana;font-size:12px;\&quot;&gt;\'+document.all.s.value+\'&lt;/a&gt;&lt;/MARQUEE&gt;','DIV')" style="color:#FF0000;background-color:#CCCCCC;font-family:Verdana;font-size:12px;">
<option selected>- Select One -</option>
<option value="http://www.searchbliss.com/Webmaster-Tools.htm">Webmaster Tools</option>
<option value="http://www.searchbliss.com/Free-Website-Content.htm">Free Website Content</option>
<option value="http://www.searchbliss.com/generators.asp">Buy Tools</option>
</select>
<div id="Layer1" style="position:absolute; z-index:1; visibility: visible; width: 700px"></div>
</td>
</tr>
</table>
</body>
</html>
[/QUOTE]
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to JavaScript in FireFox problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.54772 seconds with 12 queries