Bug Tracker

Modify

Ticket #1219 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

toggle() without parameters runs animation

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

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

comment:1 follow-up: ↓ 2 Changed 6 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 6 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 6 years ago by hobbit

The component is core.

comment:4 Changed 6 years ago by john

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in SVN rev [2129].

comment:5 Changed 6 years ago by john

  • Priority changed from minor to major

Oops, I meant rev [2130].

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.