MyBB Community Forums

Full Version: Creating simple modal box popup?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is the best way to add a simple modal box popup in Mybb?

I wish to add a section in my forum and when it is clicked, a modal box is popped up. I have tried searching for guides, but all guides don't really help with what I am looking for.

Thanks
Hi,

I would try to use the modal login of MyBB. Never tested but worth a try. Change the capitalize things:  Wink

<a href="https://YOUR_URL/FORUM_SECTION_LINK" onclick="$('#section_warn').modal({ fadeDuration: 250, keepelement: true, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;" class="login">NAME_OF_THE_SECTION</a>
<div class="modal" id="section_warn" style="display: none;">
WHATEVER YOU WANT TO DISPLAY INSIDE A DIV OR A TABLE OR A IMAGE...
</div>

Also you could change "https://YOUR_URL/FORUM_SECTION_LINK" for "#" if you don't want a default URL for non-javascript visitors.
(2019-11-26, 03:17 PM)NoRules Wrote: [ -> ]Hi,

I would try to use the modal login of MyBB. Never tested but worth a try. Change the capitalize things:  Wink

<a href="https://YOUR_URL/FORUM_SECTION_LINK" onclick="$('#section_warn').modal({ fadeDuration: 250, keepelement: true, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }); return false;" class="login">NAME_OF_THE_SECTION</a>
<div class="modal" id="section_warn" style="display: none;">
WHATEVER YOU WANT TO DISPLAY INSIDE A DIV OR A TABLE OR A IMAGE...
</div>

Also you could change "https://YOUR_URL/FORUM_SECTION_LINK" for "#" if you don't want a default URL for non-javascript visitors.

Thank u! Worked perfect Smile