MyBB Community Forums

Full Version: Login Javascript Dropdown menu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sir how can i make a javascript dropdown Login for mybb,
I tried to make one but there is a problem when im trying to enter my username or password in the box the dropdown login form will just collapse,
so my problem is i cannot enter username and password and also cannot click the remember me,
please post here on how i can make it work
any help please
You could try using jQuery for making a toggle button (show/hide). Though I haven't tested it myself on a MyBB forum, I would suggest trying the following to see if it works:

1. Add the jquery.js file to your website (you can download it here).

2.Under templates, add the following in headerinclude, (which can be found in 'Ungrouped Templates'):
<script type="text/javascript" src="/location/jquery/script/jquery-1.8.3.min.js"></script>

3. Add code in the MyBB templates to toggle visibility (the 2 <div>'s can be divided over different template files as long as they both are always present):
<div class="click_to_show">
	click here to toggle visibility
</div>
<div class="appearing_part">
	part that changes visibility (this would be the section of your MyBB forum where you could log-in and such)
</div>

4. Code that needs to get placed just above the </body> tag (somewhere in 'index' found under 'Index Page Templates'):
<script  type="text/javascript">
	$("div.click_to_show").click(function () {
		$("div.appearing_part").slideToggle("slow");
	});
</script>

5. Add the following code to your global CSS file:
div.click_to_show {

}

div.appearing_part {
	display:none;
}
IMPORTANT: You can adjust the css however you like, though in div.appearing_part it is required to have "display:none;" in it!!!

For further reading about jQuery, I suggest you might want to read links such as http://api.jquery.com/slideToggle/ and http://api.jquery.com/fadeToggle/.