简体   繁体   中英

Opening a div in Facebox programmatically

Using Facebox's documentation , I'm attempting to pop up Facebox programmatically, with the Facebox content being that of a div that is in the document.

The problem is is that it is not opening with that content - it's opening blank. What am doing wrong? The full code with example is contained in this jsFiddle: http://jsfiddle.net/N4B4v/1/

<div id="#TEST10" style="display: none;">
    HEYYYY!
    <br />
    <br />
    heyyyyy!
</div>

<div style="margin-bottom: 10px;">
    <a href="#" onclick="jQuery.facebox({ div: '#TEST10' }); return false;"><input type="checkbox" name="AgreeToRequirements" /></a>Open Facebox By Checking The Box
</div>

The id attribute is wrong. It should be just TEST10

Checkout this updated jsFiddle Demonstration

<div id="TEST10" style="display: none;">
    HEYYYY!
    <br />
    <br />
    heyyyyy!
</div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM