Wrong dimensions of slimbox window (Slimbox 1.71, Mootools 1.2, Google Chrome 8)
Closed this issue · 11 comments
What steps will reproduce the problem?
1. use mootools 1.2.x
2. add anchor over image tag with set dimensions
<a href="logo.jpg" rel="lightbox" title="logo"><img alt="logo"
src="thumbnails/logo.jpg" height="300" width="200" /></a>
3. open site in Google Chrome 8
What is the expected output? What do you see instead?
slimbox width is equal to thumbnail width
What version of the product are you using? On what operating system?
Slimbox 1.71
MooTools 1.2.4
Google Chrome 8
Windows 7 x64
Please provide any additional information below.
In all other browser everything is ok.
With mootools 1.1.x and slimbox 1.5.8 everything is also ok.
If anchor contains text and style is set to block with width and height than
there is the same bug
<a style="display:bloc;width;200px;height:300px; ... >text</a>
Original issue reported on code.google.com by mocko.piotr@gmail.com
on 15 Dec 2010 at 6:43
Attachments:
The problem in chrome seems to be the double resize effect the first
fxResize completes successfully but the second fails as the first
hasn't completed.
I have a workaround that works but the source needs to be modified at
around line 130 to combine the resize into one.
if (center.offsetHeight != centerHeight || center.offsetWidth !
= centerWidth) {
check = fxResize.start({height: centerHeight, top: top,
width: centerWidth, marginLeft: -centerWidth/2});
}
Code to be modified below
/*
if (center.offsetHeight != centerHeight) {
check = fxResize.start({height: centerHeight, top: top});
}
if (center.offsetWidth != centerWidth) {
check = fxResize.start({width: centerWidth, marginLeft: -
centerWidth/2});
}
*/
Original comment by clarksta...@gmail.com
on 26 Mar 2011 at 11:11
This issue also occurs in Firefox 4, but your patch corrects it in Firefox 4
and Google Chrome. I have tested it also in other modern browsers and IE7+ and
it working great. You should quickly apply this patch. Great job!
Original comment by mocko.piotr@gmail.com
on 27 Mar 2011 at 6:12
Your patch works great! Thank you!
Original comment by kalis...@gmail.com
on 27 Mar 2011 at 10:22
I also have this issue, but can't get it to work with the patch. I tried the
source (unminified version Slimbox v1.71), the patch is already in it, but
using this breaks lightbox on my site. Don't know if the minfied version has
the patch allready and don't know how to minify it myself. I'm stuck... Anybody?
Original comment by martinta...@gmail.com
on 29 Mar 2011 at 10:42
I have attached you corrected file.
You can minify it and shrink again variables with this online tool
http://javascriptcompressor.com/
If you want in future not minified version of scirpt, that you should download
whole ZIP pack from project site and look in folder SRC.
Original comment by mocko.piotr@gmail.com
on 29 Mar 2011 at 10:47
Attachments:
[deleted comment]
Thank you VERY much!
This is a great help!
Original comment by martinta...@gmail.com
on 29 Mar 2011 at 8:02
Is there any way to preserve the double resize effect while also fixing this
bug?
Original comment by ajbla...@gmail.com
on 16 Apr 2011 at 3:10
The slimbox-1.72.js file worked for me. It works for FF4, FF5, and FF6. Thank
you very much!
Original comment by meridith...@gmail.com
on 12 Sep 2011 at 11:25
Thank you!!! You're just legendary.
Original comment by kmaciejc...@gmail.com
on 2 Feb 2012 at 8:18
This is probably a bug in an older MooTools version. I suggest you upgrade to the new one. I can't integrate your workaround since it's technically a regression (it removes an effect to avoid a bug in some browsers/mootools versions).