/ Published in: Other
Credit to Jonathan Hersh
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!-- AppExchange Link http://sites.force.com/appexchange/listingDetail?listingId=a0N30000001g3u0EAA --> <!-- Jonathan Hersh - [email protected] - 7/13/2009 --> <apex:component selfclosing="true"> <apex:attribute name="function" description="This is the name of the JS function to call." type="String" required="true"/> <apex:attribute name="title" description="This is the title displayed in the lightbox." type="String" required="true"/> <apex:attribute name="content" description="This is the HTML content of the lightbox." type="String" required="true"/> <apex:attribute name="width" description="This is the width, in pixels, of the lightbox." type="Integer" required="true"/> <apex:attribute name="duration" description="This is the duration, in ms, to show the box before it autohides (i.e. 2000ms = 2 sec), or 0 for an untimed box." type="Integer" required="true"/> <script type="text/javascript"> function {!function}() { var box = new parent.SimpleDialog("hersh"+Math.random(), true); parent.box = box; box.setTitle("{!title}"); box.createDialog(); box.setWidth({!width}); box.setupDefaultButtons(); box.show(); if( {!duration} > 0 ) setTimeout("box.hide();",{!duration}); } </script> </apex:component>
URL: http://sites.force.com/appexchange/listingDetail?listingId=a0N30000001g3u0EAA