0
$(document).ready(function() {
   $("div").css({
       "width":"80px",
       "height":"40px",
       "margin":"5px",
       "float":"left",
       "background-color":"blue",
       "border":"10px outset",
       "cursor":"pointer"
       });

       $("div").toggle(function(){
          $(this).css({
               "border":"5px inset",
               "background-color":"red"
               });

       },function(){
           $(this).css({
               "border":"10px outset",
               "background-color":"yellow"
               });     
       },function(){
           $(this).css({
               "background-color":"blue"
               });

        });

});
j08691
  • 204,283
  • 31
  • 260
  • 272
soztrk
  • 283
  • 4
  • 13
  • replace .toggle with a click event + flag – Kevin B Feb 27 '13 at 16:07
  • 1
    toggle is deprecated in jQuery version 1.9 – Eli Feb 27 '13 at 16:08
  • jQuery toggle was removed in 1.9.1 http://jquery.com/upgrade-guide/1.9/#toggle-function-function-removed The answer at http://stackoverflow.com/questions/4911577/jquery-click-toggle-between-two-functions contains a solution. – simbolo Feb 27 '13 at 16:09

1 Answers1

2

The .toggle() you're using was deprecated in jQuery 1.8 and removed in 1.9.

http://api.jquery.com/toggle-event/

You'll need to replace it with the .click() function, or write your own function simulate the old functionality.

Community
  • 1
  • 1
j08691
  • 204,283
  • 31
  • 260
  • 272