MyBB Community Forums

Full Version: Adding a modal login box to MyBB using jQuery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Right, I've found a fix for the issue LeeFish mentioned. To implement it, simply add the following code to your JS:

$('#loginModal input[name="url"]').attr("value", window.location);

I've also added this to the code in the first post.
Thank you euantor for this great tutorial! +Repped.

I only have one question. How do I apply the dark background? I know it has something to do with z-index: 9015; but I can't seem to get it to work.
You mean the mask? It should work so long as you have the <div id="mask"><div> line of code within your template somewhere.
Thank you Euantor. Now to get this redirect to work in Prototype (I keep trying to take the jQuery OFF leefish.... Toungue )
How would I modify the text alignment on the modal box? It's a bit to much to the top-left.
(2012-04-29, 04:25 PM)Leefish Wrote: [ -> ]Thank you Euantor. Now to get this redirect to work in Prototype (I keep trying to take the jQuery OFF leefish.... Toungue )

Try this:

var redirectURLInput = $$('#loginModal input[name="url"]');
redirectURLInput[0].value = window.location;

I haven't tested it, but I believe it should work Smile

(2012-04-29, 06:35 PM)Rigby Wrote: [ -> ]How would I modify the text alignment on the modal box? It's a bit to much to the top-left.

Could you post a screenshot of what you mean exactly? It should be a simple CSS edit Smile
http://www.adminsbb.com/index.php
Click Login and it will appear.
I need to space the text a bit more to the right and lower it, as right now it looks too much to the left.
Ah, you need to add some padding to the header. Try something like this in your CSS:

.modalBox .thead {
    padding: 4px 10px;
}

It may cause some issues with your theme, but that's the basic way of doing it Big Grin
Once again, thanks man.
Hmmm... I think I will be trying this later in May. May will be a month of large change on my forum (at least, if everything works out!).
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26