[jQuery] Re: Wrong Width in Firefox

2007-08-26 Thread Ganeshji Marwaha
I can't see the 1 pixel protrusion in ur gallery right now. did u already
solve it. If yes, i am interested to know how... can u please explain.

BTW, your gallery and the gallery design in wonderful...

-GTG


On 8/24/07, b0bd0gz [EMAIL PROTECTED] wrote:



 Hi,

 I have a gallery of images and when one is loaded it gets the width of the
 image and then sets the p tag underneath the image to the same width, the
 problem is in firefox,  on SOME of the images, the width of the p tag is a
 pixel out, but in IE7 it displays everything correctly.

 here is a link to the gallery itself
 http://b0bd0gz.adsl24.co.uk/gallery2/

 and here is a link to a screenshot of the problem
 http://img44.imagevenue.com/img.php?image=75951_wrong_width_122_861lo.JPG

 heres the code that gets and then sets the width

 var imgload = img = $('img.full_img')[0];
 imgload.onload = function() {
var description = $('a.selected img').attr(alt);
var width = $('.full_img').width();
$('p.hidden').css('width', width + 16); // The + 16 is added because
 the
 image has a border
$('p.hidden').html(description);
$('p.hidden').fadeIn(slow);
 };

 I have no idea what's causing this so any ideas would be greatly welcomed.
 If you need anymore info let me know. Thanks in advance.
 b0bd0gz
 --
 View this message in context:
 http://www.nabble.com/Wrong-Width-in-Firefox-tf4324806s15494.html#a12316725
 Sent from the JQuery mailing list archive at Nabble.com.




[jQuery] Re: Wrong Width in Firefox

2007-08-26 Thread b0bd0gz


Unfortunately I haven't fixed the problem, it's still showing with me when
using Firefox 2.0.0.6, and it's really irritating because nothing seems to
fix it :(   Glad you like the design though :D

If anyone has any ideas please let us know.

b0bd0gz



I can't see the 1 pixel protrusion in ur gallery right now. did u already
solve it. If yes, i am interested to know how... can u please explain.

BTW, your gallery and the gallery design in wonderful...

-GTG
-- 
View this message in context: 
http://www.nabble.com/Wrong-Width-in-Firefox-tf4324806s15494.html#a12332786
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Wrong Width in Firefox

2007-08-26 Thread Wizzud


I suspect it's because you are using max-width and max-height to compress
your images into the available space. When the width of an oversize image is
computed the values are coming out to 3 or more decimal places, and
depending on how the rounding/truncation works out, the returned width value
that you are using for the paragraph may not exactly match the displayed
pixel width of the image. For example, if the computed image size is x.9733
you may be receiving x+1 (rounded) as the width but the image width is being
displayed (truncated) as x.
Note that this is all supposition/guesswork on my part!

A way around it might be to try wrapping your anchor/image and subsequent
paragraph in a div, and let the paragraph find its own width within that
div, which should autosize to its content (ie. the image). You should not
need to retrieve the image width at all.

I don't know whether this is helpful or not!


Unfortunately I haven't fixed the problem, it's still showing with me when
using Firefox 2.0.0.6, and it's really irritating because nothing seems to
fix it :(   Glad you like the design though :D

If anyone has any ideas please let us know.

b0bd0gz



Ganeshji Marwaha wrote:
 
 I can't see the 1 pixel protrusion in ur gallery right now. did u already
 solve it. If yes, i am interested to know how... can u please explain.
 
 BTW, your gallery and the gallery design in wonderful...
 
 -GTG
 

-- 
View this message in context: 
http://www.nabble.com/Wrong-Width-in-Firefox-tf4324806s15494.html#a12333177
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Wrong Width in Firefox

2007-08-26 Thread Wizzud


That's fine. It's along the lines of where my (not very comprehensive)
suggestion was leading!


b0bd0gz wrote:
 
 Thanks for the reply Wizzud, I think your probably right about why the
 width is out by a pixel.  Wrapping the image and paragraph in  a div did't
 work but it did lead to me figuring out a workaround.  
 
 What I did was wrap the anchor, image and paragraph in a div, then instead
 of jQuery setting the paragraphs width I made it set the wrapping div's
 width and added 18 to that value.  Then with CSS set the wrapping divs
 background colour to white.  So now the over sized div is now the white
 border and background of the paragraph. 
 
 Don't know if that explanation of what I did made any sense what so ever,
 if it didn't and you want me to try and explain it again let me know.
 
 Thanks for all the help :D
 b0b0dgz
 

-- 
View this message in context: 
http://www.nabble.com/Wrong-Width-in-Firefox-tf4324806s15494.html#a12340089
Sent from the JQuery mailing list archive at Nabble.com.