MyBB Community Forums

Full Version: [Tutorial] jQuery collapsible sidebar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13
//post removed by author
If I put the welcomeblock inside the sidebar there are jquery conflicts. (Can't open the buddy list for example) who could help me?
It only happens inside the sidebar? That's odd - I've never actually tried doing that kind of thing.
Do you mean that I have to try putting another js in another part of the forum and test it?
No, I mean that I have no idea as I've never tried doing what you're doing.
hello, simple question...where should i edit to make this show by default. thanks

<script type="text/javascript">
jQuery.noConflict();
jQuery(function($) {
    $(".forums").css("width","100%");
    $(".sidebar").hide();
    $(".buttons").hide();
    $(".buttons").click(function() {
        $(".sidebar").animate({height: "hide", opacity: 0}, 500,
            function() {
                $(".forums").animate({width: "100%"}, 500);
            });
        $(this).hide();
        $(".clickedbuttons").show();
        $.cookie("sidebar","collapsed", {expires: 365});
        return false;
    });
    $(".clickedbuttons").click(function() {
        $(".forums").animate({width: "80%"}, 500,
            function() {
                $(".sidebar").animate({height: "show", opacity: 1}, 500);
            });
        $(this).hide();
        $(".buttons").show();
        $.cookie("sidebar","expanded", {expires: 365});
        return false;
    });
    if($.cookie("sidebar") == "collapsed") {
        $(".buttons").hide();
        $(".clickedbuttons").show();
        $(".forums").css("width","100%");
        $(".sidebar").hide();
    };
});
</script>
adminCP => Themes & templates => Templates => 'Your theme' templates => ungroup templates => headerinclude

http://wiki.mybb.com/index.php/Admin_CP_Templates
thanks aglioeolio, but i'm not asking where to put this, i'm asking how to had this sidebar shown by default (collapse), i'm new to jquery so bit confusion here about where i had to edit the basic function .show and .hide
I am also willing to do the same putting inside sidebar. Let me try with separate js.
I like it... It works well, is there a way you can integrate it into my webpage?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13