Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1219 closed bug (fixed)

toggle() without parameters runs animation

Reported by: nlogax Owned by:
Priority: major Milestone: 1.1.3
Component: effects Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:

Description

I noticed in the 1.1.3 alpha that my toggle():s were running animations all of a sudden, when they should just toggle display betwen block and none.

Change History (5)

comment:1 Changed 13 years ago by hobbit

The toggle method doesn't work if it restarted under animation. A simplified sample page:

<html>
<head>
  <title>Test page</title>
  <style type="text/css">
    #first {
      border: 2px solid #ccc;
      background-color: #eee;
      padding: 2px;
      height: 150px;
      width: 350px;
    }
    #second {
      cursor: pointer;
    }
  </style>
  <script type="text/javascript" src="jq.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){

    $("#second").click(function(){
      $("#first").toggle(2000);
    });

  });
  </script>
</head>
<body>

  <div id="second">click here and click again under animation</div>
  <div id="first"></div>

</body></html>

comment:2 in reply to:  1 Changed 13 years ago by hobbit

Replying to hobbit:

The show and hide animations don't work if we add the speed parameter to the methods, and the display style is set to none.

<html>
<head>
  <title>Test page</title>
  <script type="text/javascript" src="jq.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){

    $("#first").hide(1);
    $("#second").click(function(){
      $("#first").show(1);
    });

  });
  </script>
</head>
<body>

  <div id="second">Click here</div>
  <div id="first" style="display:none">First item</div>

</body></html>

comment:3 Changed 13 years ago by hobbit

The component is core.

comment:4 Changed 13 years ago by john

Resolution: fixed
Status: newclosed

Fixed in SVN rev [2129].

comment:5 Changed 13 years ago by john

Priority: minormajor

Oops, I meant rev [2130].

Note: See TracTickets for help on using tickets.