Note that there are some explanatory texts on larger screens.

plurals
  1. POColorbox positioning on top of another element
    primarykey
    data
    text
    <p>I've got quite an issue with positioning of colorbox. The methods described on official website <a href="http://www.jacklmoore.com/colorbox/" rel="nofollow">http://www.jacklmoore.com/colorbox/</a> are not quite enough for my purpose. The thing is that I have button opening the colorbox and I need to position it "over the button" (button is 50px height, colorbox is something about 700px height so I need to center it over the button (something like 300px top of the button).</p> <p>I have tried basic repositioning with jquery in onOpen and onLoad function in colorbox like:</p> <pre><code> onOpen:function() { $('#colorbox').removeAttr('top'); $('#colorbox').css('top','200px'); }, </code></pre> <p>It works but colorbox settings automatically overwrite those settings right after onOpen or onLoad and colorbox is positioned in center of the viewport again.</p> <p>So I am basically calling for help, colorbox positioning settings like top, left etc. are simply not enough for positioning on top of the button element.</p> <p>Thanks in advance!</p> <p><strong>Edit: full code below</strong></p> <pre><code>$(".reserve_").live('click',function() { var loadUrl = $(this).attr("href"); $.colorbox({ innerWidth:660, innerHeight:720, returnFocus: true, overlayClose: true, fixed: false, iframe: true, href: loadUrl, opacity: 0.6, reposition: true, onOpen:function() { $('#colorbox').removeAttr('top');//test $('#colorbox').css('top','200px');//test }, onLoad: function() { $('#colorbox').removeAttr('top');//test $('#colorbox').css('top','200px');//test }, onClosed:function() { } }); return false; }); </code></pre> <p>EDIT 2: link on jsfiddle: <a href="http://jsfiddle.net/zS8J8/8/" rel="nofollow">http://jsfiddle.net/zS8J8/8/</a> (sorry about the messy code in CSS and HTML)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload