| pax.widget.modal.init = function( | args | ) |
|
Initialises a modal box widget
Parameters
args
- message - The contents of the modal box
- footerMessage - Optional message for the footer
- url - Ajax parameter, specifies what URL to make an ajax call to, uses GET
- src - iframe parameter, specifes what source for an iframe; do not use with url parameter
- srcElement - Optional in-page element that contains the contents for our modal
- contentDisplay - What CSS display style to use for the content, useful for integrating with different designs
- width - Width of content in pixels, default is 400
- height - Height of content in pixels, default is 300
- fitViewport - Do we shrink the modal to fit, if the viewport is too small, default is true
- footerHeight - Height of footer in pixels, default is 20
- showFooter - Show the footer, default is true
- iframe - iframe properties, should not be chnaged, see source if you need to change things
- template - pax template to use for rendering the modal, default is from pax.widget.modal.template()
Returns
nothing
Example
Modal example
<p>
<input id="showModalButton" type="button" value="Show modal"/>
</p>
Click the button do see the modal
[:.
pax.event.bind( pax.$( 'showModalButton' ), 'click', function() {
pax.widget.modal.init( {
message: 'This is the modal box message'
} );
} );
:]