This script I'm working on produces an error in the JS Console for Firefox, which says "Error: Error in parsing value for property 'left'. Declaration dropped. Line: 0".
Here is my code (actually I got it from Dynamic Drive but I heavily modified it):
var slidemenu_width='160px' //specify width of menu (in pixels) var slidemenu_reveal='15px' //specify amount that menu should protrude initially var slidemenu_top='50px' //specify vertical offset of menu on page
function pull(){ if (window.drawit) clearInterval(drawit) pullit=setInterval("pullengine()",10) }
function draw(){ clearInterval(pullit) drawit=setInterval("drawengine()",10) }
function pullengine(){ themenu= document.getElementById("slidemenubar2").style if (parseInt(themenu.left)<rightboundary) themenu.left=parseInt(themenu.left)+10+"px" else if (window.pullit){ themenu.left=0 clearInterval(pullit) } }
function drawengine(){ themenu= document.getElementById("slidemenubar2").style if (parseInt(themenu.left)>leftboundary) themenu.left=parseInt(themenu.left)-10+"px" else if (window.drawit){ themenu.left=leftboundary clearInterval(drawit) } }
The script works perfectly fine, but I'm a perfectionist and thus I don't tolerate any errors of any kind in my scripts.
Can anyone see what's producing this error and how I can fix it?
As Kari pointed out, it's very tough to debug this without all the code so we can duplicate the error... however, if I had to guess, this is probably the line that's causing the error:
Remember, if something works in IE but not Firefox, it's most likely coded incorrectly. Codefor Firefox first, then fix the IE bugs.
After looking at your code, my suggestion is to first and foremost burn your copy of FrontPage. Then do some Google searching on "web standards" and "CSS" so you can lose your font tags and stop using tables for layout (it'll make your coding life a lot better). Once you've got a good grasp on that, then you can dive into scripting... and by scripting you'll want to search for "DOM Scripting", which is using JavaScript along with the DOM (document object model)... and stay far, far away from VBscript.