jQuery: The Write Less, Do More JavaScript Library

Ticket #1219 (closed bug: fixed)

Opened 1 year ago

Last modified 1 year ago

toggle() without parameters runs animation

Reported by: nlogax Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.1.3 Component: fx
Version: 1.1.2 Keywords:
Cc: Needs: Review

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.

Attachments

Change History

follow-up: ↓ 2   Changed 1 year 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>

in reply to: ↑ 1   Changed 1 year 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>

  Changed 1 year ago by hobbit

The component is core.

  Changed 1 year ago by john

  • status changed from new to closed
  • resolution set to fixed

Fixed in SVN rev [2129].

  Changed 1 year ago by john

  • priority changed from minor to major

Oops, I meant rev [2130].

Note: See TracTickets for help on using tickets.