开发者

Body load and jquery problem

开发者 https://www.devze.com 2022-12-20 19:24 出处:网络
There is a div: <div id=\"question\">ddddd</div> I have written a开发者_JS百科 code that hide the other div:

There is a div:

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

I have written a开发者_JS百科 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


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

Then instead of using hide and show use toggle.

0

精彩评论

暂无评论...
验证码 换一张
取 消