MyBB Community Forums

Full Version: Jscript?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I was wondering how would i replace this open and close effect:
[Image: 8ebaca5316ab93ce0c89c3b81ce06676.gif]

with this nice fade in/out effect like it is with my alerts:
[Image: a5e6c8ad09a8d440ad9dd0c48328df59.gif]
I think you use popup menu only remove that and script have to change it give an normal id and then apply fadein and out or toggle efect on your on click menu ref and its done i use this on my site with the same user menu but on very songle code amd stylization xD.
this is the code on the first one, if i remove it. the menu wont open:

<script type="text/javascript">
function showHide(obj)
{
	var div = document.getElementById(obj);
	if (div.style.display == 'none')
	{
		div.style.display = '';
	}
	else
	{
		div.style.display = 'none';
	}
}
</script>

Bump, sorry i'm not good with Jscript.
couldn't you do this with CSS using transitions? ease-in-out etc...
(2014-08-09, 02:20 PM)fma965 Wrote: [ -> ]couldn't you do this with CSS using transitions? ease-in-out etc...

I'm not to sure, i need a javascript code though for the menu to function.
(2014-08-09, 03:33 PM)Billie Joe Armstrong Wrote: [ -> ]
(2014-08-09, 02:20 PM)fma965 Wrote: [ -> ]couldn't you do this with CSS using transitions? ease-in-out etc...

I'm not to sure, i need a javascript code though for the menu to function.

give me a link to your site i will see what i can do.
This should be what you want, you'll have to include jQuery though.

<script type="text/javascript">
function showHide(obj)
{
	var div = document.getElementById(obj);
 	$(div).slideToggle();
}
</script>
(2014-08-09, 06:51 PM)fma965 Wrote: [ -> ]
(2014-08-09, 03:33 PM)Billie Joe Armstrong Wrote: [ -> ]
(2014-08-09, 02:20 PM)fma965 Wrote: [ -> ]couldn't you do this with CSS using transitions? ease-in-out etc...

I'm not to sure, i need a javascript code though for the menu to function.

give me a link to your site i will see what i can do.

That would be great thank you, it's:
http://gengame.tk/index.php
(2014-08-09, 09:54 PM)Eric J. Wrote: [ -> ]This should be what you want, you'll have to include jQuery though.

<script type="text/javascript">
function showHide(obj)
{
	var div = document.getElementById(obj);
 	$(div).slideToggle();
}
</script>

If you're already including jQuery, why not use it to select the div too? Would be far simpler.
(2014-08-09, 09:54 PM)Eric J. Wrote: [ -> ]This should be what you want, you'll have to include jQuery though.

<script type="text/javascript">
function showHide(obj)
{
	var div = document.getElementById(obj);
 	$(div).slideToggle();
}
</script>

Hello, i tried replacing the current code with this in the headerinclude template
it didn't seem to work, it might just be me when adding it wrong.
I'm a noob when it comes to Jscript/JQuery
Pages: 1 2