jasmine
jasmine

Reputation:

Body load and jquery problem

There is a div:

<div id="question">ddddd</div>

I have written a code that hide the other div:

$(document).ready(function() 
        {
             $('div#dialog').hide();
             $('div#question').click(function() 
                {
                  $('div#dialog').show('slow');

                    return false;

                }
        );

     $('a.kapat').click(function() 
        {

             $('.frm').hide('slow');

            return false;

        }
     ); 
     });  

Every thing work perfect, but when page loading, the "div#dialog" is open. How can I fix this? I want to that "div#dialog" be hidden when page loading. Thanks in advance

Upvotes: 1

Views: 196

Answers (1)

Mark Arnott
Mark Arnott

Reputation: 1994

Make the <div> hidden with css to begin with.

Then instead of using hide and show use toggle.

Upvotes: 2

Related Questions