- <div id="taskEditorContainer" class="hide">
- Some content
- </div>
- <button id="taskEditorTool" class="button" type="button">Skapa ärende</button>
The hide css class is simply to ensure that the div is hidden when the page loads...
- div.hide
- {
- display:none;
- }
The jquery code looks like this...
- $(function() {
- $('button#taskEditorTool').live('click', function() {
- if ($('#taskEditorContainer').is(':visible')) {
- $('div#taskEditorContainer').hide(400);
- } else {
- $('div#taskEditorContainer').show(400);
- }
- });
- });
Showing the div works fine, hiding the div on the other hand doesn't. For some reason if I do it like this...
- $('div#taskEditorContainer').hide();
... it works just fine, but is rather ugly. On the other hand this...
- $('div#taskEditorContainer').hide(400);
... won't work at all. I've tried using 'fast' and 'slow' as well, when ever I specify a speed indicator to the hide function it won't work. Anyone else experienced this?