Colorbox doesn't seem to work with inline div

I've a question about Colorbox.

I'm trying to load an inline div in a colorbox. I've literally copy-pasted the code from the example page that comes with it and it simply won't work - I have no idea why; the page loads correctly, the colorbox opens, but there's no content inside it. I'm using MVC with a header, index and footer views, with the script on the header view and the inline on the index view (the link which calls the colorbox is on the header view). Any idea why it could not be working?

(Also, I've tried some other code that makes the colorbox open on page load and that works as expected.)

Answers


Your html should be like this. Note: div with display none first

and then your content div

    <div style="display: none"><div id="contentDiv">test content  </div></div>

Need Your Help

XSLT dumping junk at the end of my file

xml xslt

I'm using XSLT to manipulate the data inside of an XML file (I'm taking the guts of one XML file and putting them into a new shell in another XML file). I'm only using some of the data in the first...

Dynamically inserting an image with JavaScript does not work on images that 302 redirect

javascript jquery html dom redirect

I am dynamically inserting an image into an HTML document using jQuery. Here is the code: