0

How to add buttons like minimize,maximize and close to a div using javascript/jquery? Please provide easier solution..

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • 4
    This is pretty simple , show us what you've tried. ( or at least - where is the DIV) ( jsbin) – Royi Namir Dec 28 '13 at 09:04
  • agreed with Royi Namir....code snippet will help you get a quicker replies!! – NoobEditor Dec 28 '13 at 09:05
  • I just googled exact question and saw two similar questions on Stack Overflow except they don't have *close*. And the [first answer](http://stackoverflow.com/a/20812794/242583) for this question, the script part is virtually [the same](http://stackoverflow.com/a/16164752/242583) for one of those questions. – livibetter Dec 28 '13 at 09:18
  • possible duplicate of [Minimize / Maximize div's with jQuery](http://stackoverflow.com/questions/16164672/minimize-maximize-divs-with-jquery) – livibetter Dec 28 '13 at 09:20

1 Answers1

2

Try like this

<div class="content">Some content!</div>

<button class="btn-minimize"></button>

Script

$(".btn-minimize").click(function(){
    $(this).toggleClass('btn-plus');
    $(".content").slideToggle();
  });

DEMO

Sridhar R
  • 20,190
  • 6
  • 38
  • 35