I would like to make a jquery's slide toggle on the button "Sign In" where it will drop down the menu.
Website:
http://www.Vizzy.VisualizeEdits.com/
About jQuery Toggle with the .slideToggle() function:
Website:
http://rijamedia.com/blog/2011/01/simple...idetoggle/
The jQuery function:
$('#toggle4').click(function() {
$('.toggle4').slideToggle('fast');
return false;
});
The jQuery HTML Code:
<a href="#" id="toggle4">Slide Toggle</a><br /><br />
<div class="toggle4" style="display:none; background-color:#4CF;width:100px;height:200px;"></div>
I put the html in the header like this:
http://gyazo.com/2086299c732613247607b1d675ec0a3d
But I don't know where I put the function code. Am I doing it right?
Put the function in a seperate .js file the link to the .js file in the head of your html page.
<script type="text/javascript" src="/file.js"></script>
(2013-07-09, 09:37 PM)Jambuster Wrote: [ -> ]Put the function in a seperate .js file the link to the .js file in the head of your html page.
Like this?
http://gyazo.com/45b68f0523431b1a6c8a55352f5492d0
How do I make a javascript file? And link it to the header?
I really need to clean my header template so that I can make it more clearer.
(2013-07-09, 09:37 PM)Jambuster Wrote: [ -> ]Put the function in a seperate .js file the link to the .js file in the head of your html page.
I put my HTML in here
http://gyazo.com/af13d95100875dc8cd02a4e8cd566d8e
but where's the "head" to put the script in?
^ javascript file can be linked in headerinclude template (ungrouped templates)
(2013-07-10, 03:08 AM).m. Wrote: [ -> ]^ javascript file can be linked in headerinclude template (ungrouped templates)
So I put the "function" into the headerinclude template, or the
script Jambuster mentioned above?
I know about the html, I think but just need a little help with the script since I'm very new to how javascript work in MyBB.
hi bro.
add the code in
global.css not in global.php
just install it and enter this code in global.css
.spoiler_header {
background: #FFF;
border: 1px solid #CCC;
padding: 4px;
margin: 4px 0 0 0;
color: #000;
}
.spoiler_body {
background: FFF;
padding: 4px;
border: 1px solid #CCC;
border-top: 0;
color: #000;
margin: 0 0 4px 0;
}
to make it work in a thread or post use this code:
[spoiler] your word [/spoiler] or [spoiler=CHEESE!]This is a spoiler[/spoiler]
and done.
for the javascript function, please follow the method in post #2 and add suggested code in headerinclude template
(2013-07-09, 09:37 PM)Jambuster Wrote: [ -> ]Put the function in a seperate .js file the link to the .js file in the head of your html page.
How do you make a seperate .js file? When you say "head of your html page", do that mean heading (header template)? or the actual "<head>" tags?