Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The jsfiddle was helpful, I was able to use the same code as you and get it working.</p> <p>This was tested in firefox 20, chrome 26, IE 9 on Win 7. The "Open Colorbox" link isn't visible in IE using your HTML, but if you move your mouse in that area, you'll see the cursor change and if you click, Colorbox will open in the correct location.</p> <p>Here's the HTML, I changed <code>class="rezervuj"</code> to <code>id="rezervuj"</code> because we're keying on a single element rather than a bunch of images:</p> <pre><code>&lt;h3 style="margin-bottom: 300px;"&gt;TOP OF THE PAGE&lt;/h3&gt; &lt;div class="unitKontejner"&gt; &lt;div style="float:right;"&gt; &lt;a id="rezervuj" href="http://www.imgur.com"&gt; &lt;div class="reserveIt"&gt; &lt;div class="reserveIt-content"&gt; open colorbox&amp;nbsp;» &lt;/div&gt; &lt;/div&gt; &lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Here's the script that you can put in the head:</p> <pre><code>&lt;script&gt; $(document).ready(function(){ // I removed the options that were set to the default. // The top and left can be left out or set to a default, // I used them as a test to see the difference when the event hook is used. $("#rezervuj").colorbox({ iframe:true, innerWidth:660, innerHeight:720, opacity: 0.6, top: 0, left: 0 }); // Use the "cbox_complete" event hook. // It allows the colorbox div to be positioned after it opens, // but before the content is loaded. $(document).bind('cbox_complete', function(){ // Grab the position of the button, // colorbox can be positioned relative to it. var pos = $(rezervuj).position(); //console.log(pos); // Set the position of the colorbox div // You can add to or subtract from the pos values // Example: top: (pos.top + 20) + "px" $("#colorbox").css({ position: "absolute", top: pos.top + "px", left: pos.left + "px" }).show(); }); }); &lt;/script&gt; </code></pre>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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