Re: [jQuery] Recommended version

2006-09-01 Thread Klaus Hartl

Improved to take current position into account:


jQuery.swap( e, old, function() {
if (jQuery.css(e,display) != none) {
 oHeight = e.offsetHeight;
 oWidth = e.offsetWidth;
} else {
 e = $(e.cloneNode(true)).css({
 visibility: hidden, position: absolute, display: block, 
right: 0, left: 0
 }).prependTo(e.parentNode)[0];

 old[position] = jQuery.css(e.parentNode,position);
 if (old[position] ==  || old[position] == static)
 e.parentNode.style.position = relative;

 oHeight = e.clientHeight;
 oWidth = e.clientWidth;

 if (old[position] ==  || old[position] == static)
 e.parentNode.style.position = static;

 e.parentNode.removeChild(e);
}




-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Recommended version

2006-08-30 Thread Aaron Heimlich
Here's a little tidbit from The JavaScirpt Anthology that might help:Measuring Visible Tooltip Dimensions:In order for the dimensions of the tooltip to be measured it first must be appended to the document. This will automatically make it appear on the page, so to prevent the user seeing it display in the wrong position, we need to hide it. We do so by setting is visibility to hidden until we have finalized the tooltip's position.
We can't use the more familiar display property here, because objects with display set to none are not rendered at all, so they have no dimensions to measure.
On 8/30/06, Klaus Hartl [EMAIL PROTECTED] wrote:
John Resig schrieb: position: absolute becomes position: static, prependTo(body)[0] becomes prependTo(e.parentNode)[0] However, the problem continues to be that you can't do that without
 severe implications. Since you're adding an additional element into the parent, it will push the rest of the contents down - and that will definitely cause a flash of content moving around. If we can ever,
 reliably, figure out how to get the accurate height/width of an element that has display: none, that'll sure be nice.I see. The problem is, that if you set something to position: absolute,it shrinks to fit. Maybe this is also the reason why the height is
miscalculated.Another point is that if I append some element to the body, it mayinherit other styles than where it originally was. Apart from that, inmy case the element in question is a dd element. Appending that to the
body results in invalid html, and than results may be unpredictable anyway.And I couldn't see that flash of content although, but maybe my computeris too fast.Maybe you could wrap another element around it with overflow: hidden and
height: 0, not sure if that works...-- Klaus___jQuery mailing listdiscuss@jquery.com
http://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Recommended version

2006-08-30 Thread John Resig
 We can't use the more familiar display property here, because objects with
 display set to none are not rendered at all, so they have no dimensions
 to measure.

This is precisely what jQuery does already. It adds the element to the
body, with a visibility of hidden - just to get a semi-correct
width/height reading. It's very frustrating.

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Recommended version

2006-08-25 Thread Klaus Hartl


John Resig schrieb:
 Klaus,
 
 Good news! Any chance that the slide bug I mentioned two times will be
 fixed until then? This is the only thing that holds me back from
 switching to 1.0. You can see it here:

 http://stilbuero.de/jquery/tabs/ (see the slide example - the height is
 somehow miscalculated...)

 Or maybe I'm simply doing something wrong?
 
 Using the latest jquery-svn.js and making two changes to your code:
 
 Removing stuff like: .css({display: '', height: 'auto'});
 and: .css('display', 'none')
 
 Makes it works perfectly. It doesn't completely explain why its
 happening - but at least it works now.
 


Hi John, I made a new build an hour ago (226) and removed all that code 
you mentioned, but the bug still occurs (in Firefox at least)... :-(


Any ideas?


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Recommended version

2006-08-25 Thread Klaus Hartl

 Good news! Any chance that the slide bug I mentioned two times will be
 fixed until then? This is the only thing that holds me back from
 switching to 1.0. You can see it here:

 http://stilbuero.de/jquery/tabs/ (see the slide example - the height is
 somehow miscalculated...)

 Or maybe I'm simply doing something wrong?
 Using the latest jquery-svn.js and making two changes to your code:

 Removing stuff like: .css({display: '', height: 'auto'});
 and: .css('display', 'none')

 Makes it works perfectly. It doesn't completely explain why its
 happening - but at least it works now.

 
 
 Hi John, I made a new build an hour ago (226) and removed all that code 
 you mentioned, but the bug still occurs (in Firefox at least)... :-(
 
 
 Any ideas?


If I change line 943:

jQuery.swap( e, { visibility: hidden, position: absolute, display: 
block },

to this:

jQuery.swap( e, { display: block },

everything works out fine. The height is calculated wrong with the other 
styles applied (this my also be a bug in Firefox). I assume you are 
cloning the element if it is not displayed to retrieve width and height 
here, but I can't really tell and don't know what side effects this 
change might have...

But if so I think its sufficient to not append the clone to the DOM.


-- Klaus


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Recommended version

2006-08-25 Thread Klaus Hartl

 One quick thing about your demo page - you have some PHP at the top of
 your jquery.js file which causes issues in Opera, etc.

Ups, I copied that from another project... fixed.


 I'll see if I can get a demo up of my page, that works, without that
 particular change.

Thanks for your efforts!


-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Recommended version

2006-08-24 Thread Markus Peter
Hello

I haven't followed the mailing list for quite some time, so I'm not  
fully up-to-date:

What's the currently recommended jQuery version to use if I'm still  
in development of my site, do not expect to re-launch it within next  
3 months, but want an as-soft-as-possible migration to the next  
stable version as possible as soon as it's released?

I'm willing to live with some bugs in the code while I still develop  
but I'd like to develop for an as stable API as possible, so I'm a  
bit reluctant to use the old stable version of jQuery.

-- 
Markus Peter - SPiN AG   
[EMAIL PROTECTED]
Get Firefox! Smaller, Safer, Faster: http://www.spin.de/ffox




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Recommended version

2006-08-24 Thread John Resig
 I'd recommend the latest SVN version then:
 http://jquery.com/src/jquery-svn.js
 There has been a lot of API changes lately and with 1.0 in reach, it's
 unlikely that there will be any more to this version. Only bug fixes.

I was going to say the same thing - jQuery 1.0 comes out this Friday,
so there'll only be a couple bug fixes inbetween the version you see
above and what will finally be released.

--John

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Recommended version

2006-08-24 Thread Roman
Stefan Petre wrote:
 Great news. I can finally release the Interface with the new changes, 
 website and plugins.

That's awesome! I can't wait to use it. I've struggled so much with the 
buggy versions, I had to quit and wait for the proper release. Finally 
it's the time :)

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/