Closed (fixed)
Project:
Colorbox
Version:
7.x-1.3
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Jul 2012 at 09:55 UTC
Updated:
23 Jun 2013 at 23:35 UTC
Too far to the left on the iPad (both the iPad 2 and 3). Drupal 7 BlueMasters theme. No problem on my Windows and Mac desktops. Max width set to 100%.
| Comment | File | Size | Author |
|---|---|---|---|
| colorbox-ipad.jpg | 270.95 KB | d_hall |
Comments
Comment #1
d_hall commentedComment #2
frjo commentedI will try this out but I strongly suspect that this is a Colorbox plugin issue and not a Colorbox module one and therefor outside of my control.
Comment #3
frjo commentedCould you test with some other themes? I'm using a Zen sub theme on my site and the Colorboxes centre nicely there on the iPad 2.
Comment #4
woop_light commentedI've hijacked the Framework theme (http://drupal.org/project/framework/) and I'm experiencing the issue as d_hall described it. The rendered colorbox is left of center on iPad, but appears centered on desktop. Tried using both Safari and Chrome on the iPad and experienced the issue with both.
http://dev.thehopkinscompany.com/portfolio/french ... just click any of the projects to pull up the images in colorbox.
(If you get "the image failed to load" for any reason, try clicking a different project on the page)
Comment #5
woop_light commentedFigured it out! The Colorbox is off center because my webpage is 1021px wide. Reading a little bit about it (http://x7.fi/2010/02/12/how-to-fit-your-website-for-the-apple-ipad/), I suspect if my webpage was 980px wide, there would be no issues at all.
When the iPad rendered my webpage, it was using this meta tag in the header:
That line of code generically fits the webpage to a mobile device, and for whatever reason the Colorbox doesn't do so well (FYI my Lightbox2 was having fits too).
To fix the problem I changed that line of code to tell the iPad specifically how wide my webpage was:
This fixed the problem for both my Colorbox and my Lightbox. Looks pretty good and I think it loads faster as well.
(Note I wanted to have a small border on the sides of content so I used 1050 instead of 1021.)
This should clear things up.
------------
A quick note on implementation. I'm not sure how it's best to add this code to your header. Poking around it seemed that people had some overkill ideas involving the template.php file, but maybe there's a reason for doing it that way. For my theme I hijacked the "Framework" template. In the html.tpl.php file, there's a head section:
I simply edited the head section of the html.tpl.php file, which will flow through to all pages.
Comment #6
frjo commentedComment #7
d_hall commentedwoop_light's fix worked great for me. Thanks!
Comment #9
turbat@paoluccicommarts.com commentedThank you! It solved the problem!
Comment #10
usefu commentedYep - thanks much! You saved my evening.
Comment #10.0
usefu commentededit