By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,968 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,968 IT Pros & Developers. It's quick & easy.

Slow iframe rendering - firefox

P: n/a
Hi,

i am using onmouse tooltip on my website. Under them i use iframe to
hide form elements if is tooltip above them. Everything works fine
only at firefox there is +-1sec "refresh" when tooltip function is
called and iframe is appended to the document.

CODE:
//create iframe element
var ifr = document.createElement('iframe');
// i try this to avoid "refreshing"
ifr.src = 'javascript:null';
ifr.style.position = "absolute";
ifr.style.border = 0;
ifr.border = 0;
ifr.id = lbl+'_ifr';
// position it under tooltip div
ifr.style.top = o.style.top;
ifr.style.left = o.style.left;
ifr.style.width = o.offsetWidth;
ifr.style.height = o.offsetHeight;
//append to the body
document.body.appendChild(ifr);

When i comment append method, function works fast in FF. I know that
FF is very slow with javascript but this is more then i expected.

Thx for help

Jun 12 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Reflex,

Don't worry at all, the iframe is not needed for Firefox PERIOD.

The iframe is only required for IE6 and below, and is the classic hack
to block out select elements that don't obey they z-ordering.

only load the iframe for IE6 and below (this was fixed in IE7)...
since it will unnecessarily create a brand new window object that
isn't needed at all.

Cheers
Steve

On Jun 12, 4:56 am, reflex <reflexa...@gmail.comwrote:
Hi,

i am using onmouse tooltip on my website. Under them i use iframe to
hide form elements if is tooltip above them. Everything works fine
only at firefox there is +-1sec "refresh" when tooltip function is
called and iframe is appended to the document.

CODE:
//create iframe element
var ifr = document.createElement('iframe');
// i try this to avoid "refreshing"
ifr.src = 'javascript:null';
ifr.style.position = "absolute";
ifr.style.border = 0;
ifr.border = 0;
ifr.id = lbl+'_ifr';
// position it under tooltip div
ifr.style.top = o.style.top;
ifr.style.left = o.style.left;
ifr.style.width = o.offsetWidth;
ifr.style.height = o.offsetHeight;
//append to the body
document.body.appendChild(ifr);

When i comment append method, function works fast in FF. I know that
FF is very slow with javascript but this is more then i expected.

Thx for help

Jun 12 '07 #2

P: n/a

reflex wrote:
Hi,

i am using onmouse tooltip on my website. Under them i use iframe to
hide form elements if is tooltip above them. Everything works fine
only at firefox there is +-1sec "refresh" when tooltip function is
called and iframe is appended to the document.
Steve is completely right, but if it is hard to modify code or you use
iframe for another purpose then remove
ifr.src = 'javascript:null';
and don't set src property at all.
Regards, Mykola

Jun 12 '07 #3

P: n/a
Thx both of you! I dont realize that i dont have to use iframe with
firefox.

iframe for another purpose then remove
ifr.src = 'javascript:null';
I tried this before. It is purposely to avoid iframe "refreshing". I
dont need answer anymore, but i will be happy to know solution how to
avoid this "refreshing".
Cya
reflex

Jun 13 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.