MyBB Community Forums

Full Version: [1.8] Using MyBB Modals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Alright, so here's how I did it:

First I added a new modal container:

<div id="other-form" style="display: none;">Testing!</div>

Then I added this link to the first modal (In this case, the login one):

<a href="#" class="changelink">Test</a>

And lastly I added this JS:

  $('.changelink').on('click', function() {
    $('#login-form').fadeOut('slow', function() { 
      $('#login-form').html($('#other-form').html()); 
      $('#login-form').fadeIn(); 
    });
  });

Worked like a charm, let me know if it gives you any problems. Also note that if they close the modal, when it's re-opened it won't have the original contents in it, those have to be changed back as well, or the page has to be refreshed. I'd provide a fix but I imagine this is the preferred functionality for plugins.
How to make this work with 1.6 and without jquery?
Excellent, thanks Eric. I haven't had time to sit down and make sure that it works, but I'll let you know once I have the chance.

Marcus, google "Prototype js modals" and you'll get some results that might be what you're looking for. This particular tutorial is specific to jQuery and needs the jQuery library to work.
(2014-08-16, 11:49 AM)marcus123 Wrote: [ -> ]How to make this work with 1.6 and without jquery?

Well, MyBB uses this modal. So you'd just follow the installation instructions for it, then follow these instructions.

One thing though, Pirata added an extra function to the plugin that you'll need, so using the MyBB version would probably be best.
thanks used it to make users details pop up in a modal.
In 1.6 I would have loved this for the quick reply form, no longer Toungue
(2014-08-11, 09:24 PM)Eric J. Wrote: [ -> ]/.../

Working on an Ajax modal tutorial so look for that. Smile

What about this, Eric?
(2014-10-13, 09:09 PM)Adriano Wrote: [ -> ]
(2014-08-11, 09:24 PM)Eric J. Wrote: [ -> ]/.../

Working on an Ajax modal tutorial so look for that. Smile

What about this, Eric?

Honestly it had slipped my mind for a bit between everything going on lately. I do still plan to work on this in the future however. Smile
What exactly do you want to achieve @Adriano? Are you developin an plugin? If so, check out my OUGC Custom Reputation plugin, it does uses the default modal on AJAX requests, it even uses pagination.
(2014-10-13, 10:52 PM)OmarĀ G. Wrote: [ -> ]What exactly do you want to achieve @Adriano? Are you developin an plugin? If so, check out my OUGC Custom Reputation plugin, it does uses the default modal on AJAX requests, it even uses pagination.

I'm developing a new theme for my forum and wanted to make some improvements, for example a modal window for latest received warnings in user control panel etc.
I will look into your plugin and try to do something similar on my board. Thanks!
Pages: 1 2 3