Modify ↓
Ticket #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: | ||
| 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: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>
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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>