2012-08-16, 07:16 AM
I've found this somewhere for WordPress which I've just modified and implemented for MyBB.
Goto:
ACP > Templates & Styles > Templates > {Your_Theme} Templates > Ungrouped Templates > headerinclude
Now find the line:
Add after this:
Save it and open your Footer Template:
ACP > Templates & Styles > Templates > {Your_Theme} Templates > Footer Templates > Footer
Add this script function at the very beginning:
Now add your sliding footer content just after this:
Time for the styling part. Create a new footer.css (or you may just add to your global.css):
ACP > Templates & Styles > Themes > {Your_Theme} > Add Stylesheet
Enter FileName : "footer.css" (without quotes, remember to include .css)
Select Attached To: "Globally"
Select "Write My Own Content". A huge textarea will appear. Paste the following code in it and save stylesheet.
You can further re-color and decorate your sliding footer changing the properties in the css.
Now, upload the navigation buttons to your /image folder. I'm attaching two blue 'up' and 'down' 24x24 png images for you:
[attachment=27075][attachment=27074]
But if you decide to change those; remember to change the paths of the buttons in CSS:
#footerSlideButton {
background: url(images/footerUp.png) top left no-repeat transparent;
as well as in the button function in your footer template:
buttonState.style.backgroundImage="url('images/footerDn.png')";
buttonState.style.backgroundImage="url('images/footerUp.png')";
Also make sure about the size of your arrow picture. If it is not 24x24 then you have to modify the size with yours in CSS:
#footerSlideButton {
.
.
width:24px;
height:24px;
.
}
End result:
Live demo: http://equinoxdesign.net
Base Code Credit: Paul Robinson (thanks)
Goto:
ACP > Templates & Styles > Templates > {Your_Theme} Templates > Ungrouped Templates > headerinclude
Now find the line:
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1600"></script>
Add after this:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>
Save it and open your Footer Template:
ACP > Templates & Styles > Templates > {Your_Theme} Templates > Footer Templates > Footer
Add this script function at the very beginning:
<script type="text/javascript">
jQuery.noConflict();
jQuery(function($) {
var footopen = false;
var buttonState=document.getElementById("footerSlideButton");
$('#footerSlideButton').click(function() {
if(footopen === false) {
$('#footerSlideContent').animate({ height: '300px' });
$(this).css('backgroundPosition', 'bottom left');
buttonState.style.backgroundImage="url('images/footerDn.png')";
footopen = true;
} else {
$('#footerSlideContent').animate({ height: '30px' });
$(this).css('backgroundPosition', 'top left');
buttonState.style.backgroundImage="url('images/footerUp.png')";
footopen = false;
};
});
});
</script>
Now add your sliding footer content just after this:
<div id="footerSlideContainer">
<div id="footerSlideButton"></div>
<div id="footerSlideContent">
<div id="footerSlideText">
<hr class="hidden" />
<span style="float:left">
<!-- MyBB is free software developed and maintained by a volunteer community.
It would be much appreciated by the MyBB Group if you left the full copyright and "powered by" notice intact,
to show your support for MyBB. If you choose to remove or modify the copyright below,
you may be refused support on the MyBB Community Forums.
This is free software, support us and we'll support you. -->
{$lang->powered_by} <a href="http://mybb.com/" target="_blank">MyBB{$mybbversion}</a>, © 2002-{$copy_year} <a href="http://mybb.com/" target="_blank">MyBB Group</a>.<br />
<!-- End powered by -->
</span>
<span style="float:right">
Sliding Footer By <a href="mailto:[email protected]?subject=Feedback" target="_blank">effone</a> of <a href="http://equinoxdesign.net" target="_blank">Equinox Design</a>.
</span>
<br />
<br class="clear" />
<h3>Add your content here.</h3>
</div>
</div>
</div>
(modify as required).Time for the styling part. Create a new footer.css (or you may just add to your global.css):
ACP > Templates & Styles > Themes > {Your_Theme} > Add Stylesheet
Enter FileName : "footer.css" (without quotes, remember to include .css)
Select Attached To: "Globally"
Select "Write My Own Content". A huge textarea will appear. Paste the following code in it and save stylesheet.
#footerSlideContainer {
position: fixed;
left:0;
bottom:0;
width: 100%;
}
#footerSlideButton {
background: url(images/footerUp.png) top left no-repeat transparent;
position: absolute;
top: -25px;
right: 20px;
width:24px;
height:24px;
border: none;
cursor: pointer;
}
#footerSlideContent {
width: 100%;
height: 30px;
border-top: #5b5a5a 1px solid;
background: #0264a3;
}
#footerSlideText {
padding: 10px 20px;
text-align: center; /* IE 5 fix */
font: 11px Verdana, Arial, Sans-Serif;
margin: 0px;
}
#footerSlideText a:link, #footerSlideText a:visited {
color: #488eff;
text-decoration: none;
}
#footerSlideText a:hover, #footerSlideText a:active {
color: #ffffff;
text-decoration: none;
}
You can further re-color and decorate your sliding footer changing the properties in the css.
Now, upload the navigation buttons to your /image folder. I'm attaching two blue 'up' and 'down' 24x24 png images for you:
[attachment=27075][attachment=27074]
But if you decide to change those; remember to change the paths of the buttons in CSS:
#footerSlideButton {
background: url(images/footerUp.png) top left no-repeat transparent;
as well as in the button function in your footer template:
buttonState.style.backgroundImage="url('images/footerDn.png')";
buttonState.style.backgroundImage="url('images/footerUp.png')";
Also make sure about the size of your arrow picture. If it is not 24x24 then you have to modify the size with yours in CSS:
#footerSlideButton {
.
.
width:24px;
height:24px;
.
}
End result:
Live demo: http://equinoxdesign.net
Base Code Credit: Paul Robinson (thanks)