http://img163.imageshack.us/img163/6248/93306989.jpg
the images above show what i want,
i'm using Facebox to do the pop up content,so how can i make the pop up content dynamic?
<script type="text/javascript">
    $(function() {
        $('.openExample').click(function() {
            $.facebox($('#exampleSource').val()); 
            return false;
        });
    });
</script>
the code above work just fine,but how can edit to reusable???
<form>
<textarea id="exampleSource" class="expand">
<html>
<body>
<h1>Heading</h1>
<p>paragraph.</p>
</body>
</html> 
</textarea>
<input type="Submit" value="Submit" class="openExample" />
<input type="reset" valu开发者_运维知识库e="Reset" />
</form>
Create a function that accepts string or id of the element.
example:
function popWindow(elementID)
{
    $('.openExample').click(function() {
        $.facebox($(elementID).val()); 
        return false;
    });
}
call it like this popWindow('#exampleSource');
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论