我在背景中有一大堆css但是当我加载页面时,css会显示我已经应用的所有标记和CSS我应该怎么做才能在我们加载页面时不显示背景css和标记?< / p>
任何想法的朋友?
后台CSS意味着
suppose i am displaying only two buttons like login and signup and on
clicking of signup or login the another div comes as a form for it so when
I am loading the page it is not directly showing only login and signup
button but first for fraction of second it is showing the both the form then
that two buttons
此处jsFiddle
在Js Fiddle你将无法看到效果但是当我将div loginPage加载为鳗鱼作为注册页面显示一小段时间然后只有那两个按钮正在显示
背后的原因是什么? 隐藏操作?或其他什么或是否隐藏操作,以便在启动时隐藏它们?
答案 0 :(得分:0)
答案 1 :(得分:0)
而不是使用javascript隐藏你的div。使用style="display:none;"
//$('#LoginPage').hide();
//$('#SignupPage').hide();
$('#login').click(function(){
$('#LoginPage').stop().toggle('slow').animate(1000);
});
$('#signup').click(function(){
$('#SignupPage').stop().toggle('slow').animate(1000);
});
input[type=submit]
{
display:block;
margin: 0 auto;
}
input[type=text],input[type=password]{
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius: 5px;
border: solid 1px blue;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id ="loginsignup">
<input type="button" id ="login" value="Login"/>
<input type="button" id ="signup" value="Signup"/>
</div>
<div id="LoginPage" style="display:none;">
<table align="center">
<tr>
<td>
Email :
</td>
<td>
<input type="text" id="unamelogin" name="unamelogin" />
</td>
</tr>
<tr>
<td>
Password :
</td>
<td>
<input type="password" id="pswlogin" name="pswlogin" />
</td>
</tr>
</table>
<input type="submit" id ="loginsubmit" value="Login"/>
</div>
<div id="SignupPage" style="display:none;">
<table align="center">
<tr>
<td>
Email :
</td>
<td>
<input type="text" id="emaillogin" name="emaillogin" />
</td>
</tr>
<tr>
<td>
UserName :
</td>
<td>
<input type="text" id="unamelogin" name="unamelogin" />
</td>
</tr>
<tr>
<td>
Password :
</td>
<td>
<input type="password" id="pswlogin" name="pswlogin" />
</td>
</tr>
<tr>
<td>
Confirm Password :
</td>
<td>
<input type="password" id="pswagain" name="pswagain" />
</td>
</tr>
</table>
<input type="submit" id ="signupsubmit" value="signup"/>
</div>