MyBB Community Forums

Full Version: How to use modal box for text content only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to use modal box to show text content only. like in home page header i add "Important News" if someone click a modal box will appear where some text content will show. something like this.



http://jsfiddle.net/EYAY2/4/



i want to use in build mybb modal, otherwise jsfiddle code also works too.
Use a link:
<a onclick="$('#custom_modal_name').modal({ fadeDuration: 250, keepelement: true, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;" style="cursor: pointer;">Link Name</a>

Input the modal:
<div class="modal" id="custom_modal_name" style="display: none;">
 modal contents here....
</div>

Change the ID of the modal to suit your needs. Current ID is custom_modal_name but you could change it to important_news for this box.