Back To Top
Login
Register
Visit Us At TwitterVisit Us At YouTubeVisit Us At Facebook
KandiChat is in Beta Release. Try It Out
HomeHome  
  • UpdatesUpdates  
  • SearchSearch  
  • RegisterRegister  
  • Log inLog in  
  • November 2017
    MonTueWedThuFriSatSun
      12345
    6789101112
    13141516171819
    20212223242526
    27282930   

    Calendar Calendar

    Search
     
     

    Display results as :
     


    Rechercher Advanced Search

    Shopmotion


    Who is online?
    In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest

    None

    Most users ever online was 22 on June 26th 2013, 6:10 am
    RSS feeds


    Poll
    Top posting users this week


    View previous topic View next topic Go down  Message [Page 1 of 1]

    avatar

    Widget Toggler

    Mr.EasyBB
    03/22/2013
    Hey guys, so here is a code that works for every single version of forums. All you have to do is add it to the javascript management and mark it all pages. This code adds a button, you can change the button to something else which is on lines 2 & 3. Also the buttons are for both Left and Right but no worries guys If you don't have one or the other on the button will not be added! I will be working later to add a cookie to this so the user doesn't have to keep clicking the hide or show buttons.
    One tip guys, go to your widgets management and find the pixel width of your widgets. Then add that to the var oriWidth. It will be crucial to your easy effect, this is on line 7. Nothing else very easy right!

    UPDATE:
    This code now offers COOKIE ENABLED. So everytime you go to a new page the widgets that are shown or hidden will be as same.


    Ok here is the code:

    [hc = Click To View Code]
    Code:
    $(function() {
      $('#left').before('<div id="left_widg"><button>Close</button></span>');
      $('#right').before('<div id="right_widg"><button>Close</button></span>');
      $('#left_widg button').on('click',function() {    
      var _checkme = $('#left').css('display');
        var oriWidth = 180;
    if(_checkme === "block") {
      SetCookie('closeWidgetsLeft', 'true', 100);
      $('#left').animate({width:'-='+ oriWidth +'px'},500,function() {
      $(this).hide();
      $('#left_widg button').html('Open');
    });
    } else {
     $('#left').show();
      $('#left').animate({width:'+='+ oriWidth +'px'},500,function() {
      $('#left_widg button').html('Close'); 
      SetCookie('closeWidgetsRight', 'true', 0);
    });
    }
    });
      $('#right_widg button').on('click',function() {    
      var _checkme = $('#right').css('display');
        var oriWidth = 180;
    if(_checkme === "block") {
          SetCookie('closeWidgetsRight', 'true', 100);
      $('#right').animate({width:'-='+ oriWidth +'px'},500,function() {
      $(this).hide();
      $('#right_widg button').html('Open');
    });
    } else {
     $('#right').show();
     SetCookie('closeWidgetsRight', 'true', 0);
      $('#right').animate({width:'+='+ oriWidth +'px'},500,function() {
      $('#right_widg button').html('Close'); 
    });
    }
    });
    if (ReadCookie('closeWidgetsLeft') == 'true') {
       $('#left').css('display','none');
    } else if (ReadCookie('closeWidgetsRight') == 'true') {
       $('#right').css('display','none');
    }
    });
    [/hc]

    You will need the below cookie script as well

    [hc = Cookies Script]
    Code:
    function SetCookie(cookieName,cookieValue,nDays) {
        var today = new Date();
        var expire = new Date();
        if (nDays==null || nDays==0) nDays=1;
        expire.setTime(today.getTime() + 3600000*24*nDays);
        document.cookie = cookieName+"="+escape(cookieValue)
            + ";expires="+expire.toGMTString();
    }
    function ReadCookie(cookieName) {
        var theCookie=""+document.cookie;
        var ind=theCookie.indexOf(cookieName+"=");
        if (ind==-1 || cookieName=="") return "";
        var ind1=theCookie.indexOf(";",ind);
        if (ind1==-1) ind1=theCookie.length; 
        return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
    }
    [/hc]

    Share this post on: Excite BookmarksDiggRedditDel.icio.usGoogleLiveSlashdotNetscapeTechnoratiStumbleUponNewsvineFurlYahooSmarking

    avatar
    is this for all widget toggle ? or individual ?

    Post on March 23rd 2013, 10:02 pm by tommycoo

    avatar
    This is for the entire left side or right side widgets. 

    Post on March 24th 2013, 12:31 am by Mr.EasyBB

    avatar
    can u make for individual widget ?

    Post on April 6th 2013, 9:40 pm by tommycoo

    avatar
    Yes I can. I will post a script and post the page url once I am finished. I will also be updating this script too.

    Post on April 7th 2013, 9:09 pm by Mr.EasyBB

    avatar
    I am working on an Individual widget toggler with features like, Minimize and Expand. Get rid of the widgets you don't use, as well as reset the widgets. This of course will be cookie enabled as well.

    Post on April 11th 2013, 1:50 am by Mr.EasyBB

    avatar
    how is going easy ? did u can make for individual?

    Post on June 4th 2013, 2:11 am by tommycoo

    avatar
    Oh yeah sorry Tommycoo, I was in development on this and while doing so I got into the KandiChat Dev and totally forgot about it. I will take a look at it again in a few ok

    Post on June 4th 2013, 5:00 pm by Mr.EasyBB

    avatar
    Okay no problem easy Smile
    btw your kandi chat is cool, very well design and full color like facebook chat Very Happy

    good work

    Post on June 6th 2013, 4:15 am by tommycoo

    avatar
    I'll be taking a look at this today or tomorrow ok man

    Post on June 7th 2013, 4:47 pm by Mr.EasyBB

    Post  by Sponsored content

    View previous topic View next topic Back to top  Message [Page 1 of 1]