Closed (fixed)
Project:
Colorbox
Version:
7.x-1.2
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2011 at 10:50 UTC
Updated:
3 Jan 2012 at 08:32 UTC
By default the colorbox appears centered both vertically and horizontally on the screen. Is there a way to change that, for example to 10% from top vertically and centered horizontally?
Comments
Comment #1
enrikito commented¿?
Comment #2
hutch commentedIn the documentation for colorbox on colorpowered.com you will see that there are 4 settings, top, bottom, left and right which can be used to override the default placement. However the colorbox module does not as it stands support these settings. What you can do is write your own javascript using jQuery that does use these settings and add it to your theme.
Comment #3
enrikito commentedthanks
Comment #4
julien.reulos commentedJust for the record, I confirm that colorbox repositionning is possible adding this piece of jQuery code in your own module:
$('a#some-id').colorbox({top:50, left:50});Just change "some-id" for your own link ID, and adjust top and left values to your needs. Top, left, bottom, right properties are available.
Alternatively, you can pass the position parameters directly in the URL, like this:
<a class="colorbox-load" href="http://player.vimeo.com/video/30403047?width=300&height=150&top=40&right=20&iframe=true">link</a>