General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Why following JavaScript not working in KM?
Posted by: playwin2_lost_Pwd
Date: October 18, 2008 03:44PM

Hello,
Following script works fine in Opera 9 and IE 7, but not working in KM 1.5,
can anyone help, I'm not a web developer so my knowledge reagarding scripts are quite limited, so I'm asking here...

Q2) BTW I lost my password for this forum and the "Forgot pwd" option in the log-in page isn't working for me, can anyone help?

The Script
==========
function Glide(id, pos){
var Upos = pos;
var MyImg = document.getElementById(id);

var IW = MyImg.width;
var IH = MyImg.height;
var DW = document.body.clientWidth;
var DH = document.body.clientHeight;
var SL = document.body.scrollLeft;
var ST = document.body.scrollTop;

if(Upos == 1){ //Top,Left
MyImg.style.posLeft = SL;
MyImg.style.posTop = ST;
}
else if(Upos == 2){ //Bottom,Left
MyImg.style.posLeft = SL;
MyImg.style.posTop = DH + ST - IH;
}
else if(Upos == 3){ //Top,Right
MyImg.style.posLeft = DW + SL - IW;
MyImg.style.posTop = ST;
}
else if(Upos == 4){ //Bottom,Right
MyImg.style.posLeft = DW + SL - IW;
MyImg.style.posTop = DH + ST - IH;
}
//MyImg.style.zIndex = "-1";
MyImg.style.visibility = "visible";
}

And in the HTML
=================
<BODY onload="Glide('theImg', 4)" onresize="Glide('theImg', 4)" onscroll="Glide('theImg', 4)">
<IMG id=theImg style="visibility:hidden ; LEFT:0; WIDTH:100px; POSITION:absolute; TOP:0; HEIGHT: 150px; height:150" src="20.jpg">

Thanks for any clues...

Options: ReplyQuote
Re: Why following JavaScript not working in KM?
Posted by: guenter
Date: October 18, 2008 08:51PM

IE 7 does not use standart ECMA Script but the Microsoft version called JScript (Opera can read both standart ECMA Script and JScript. Wikipedia).


? K-Meleon has a JavaScript console. At the bottom of the Tools menue.

Set it to catch JavaScript errors and run Your Script.

p.s. If Your mail is correct let Forum send new pwd.



Edited 3 time(s). Last edit at 10/19/2008 09:44AM by guenter.

Options: ReplyQuote
Re: Why following JavaScript not working in KM?
Posted by: huub
Date: October 18, 2008 09:05PM

maybe ou must always use px in the positioning string

Options: ReplyQuote
Re: Why following JavaScript not working in KM?
Posted by: playwin2_lost_pwd
Date: October 19, 2008 09:45PM

Hello,

Thanks it's solved.smiling smiley
Turns out that I need to use MyImg.style.top and MyImg.style.left instead of MyImg.style.posTop & MyImg.style.posLeft.:O

Quote

p.s. If Your mail is correct let Forum send new pwd.
well it's says the new pwd is sent to the email, but I never received the mail.
I tried lots of time.sad smiley

Options: ReplyQuote
Re: Why following JavaScript not working in KM?
Posted by: guenter
Date: October 20, 2008 09:43AM

re-check Your mail. if no result mail me directly.

Options: ReplyQuote
Re: Why following JavaScript not working in KM?
Posted by: playwin2
Date: October 20, 2008 10:16AM

grinning smiley grinning smiley grinning smiley

Oh! Thank you so much dear guenter,
I really appreciate. [thumbs up]

Here is a cup of coffee for you:




Edited 1 time(s). Last edit at 10/20/2008 10:16AM by playwin2.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.