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
(2014-08-10, 09:19 AM)Euan T Wrote: [ -> ]
(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.

Well, he said he didn't know much about JS, and I'd imagine he has some inline JS that he'd have to change on an element if the whole script were changed. Toungue

But it certainly would be less code.
anyone else got a solve? still noobish with this Sad
Pages: 1 2