Today, I ‘d like to share with how to make a toggle panel using HTML, CSS and jQuery.
After days researching and googling about this topic, I’m really happy with this solution because have clear design, contains fixed area and hyperlinks whatever you want. Even, you can integrate that in SharePoint environment using Client-side rendering if you want. See the below image:
functionfirst(e) { //Code for first time click goes here e.preventDefault(); panel.stop().animate({right: 0},200, function(){}); imgButton.stop().animate({left: -25},200, function(){}); $(this).one("click", second); } functionsecond(e) { //Code for second time click goes here e.preventDefault(); panel.stop().animate({right: -402},200, function(){}); imgButton.stop().animate({left: 0},200, function(){}); $(this).one("click", first); } button.one("click", first); });
Note: Using jQuery 1.11.x we need to change the way on we working with .toggle function, because it is not supported to use toggle with two functions, so in the above code toggle function was replaced by first and second functions.