如何在div元素悬停时显示div并使用javascript登录 [英] how to show div on hover of div element and login using javascript

查看:78
本文介绍了如何在div元素悬停时显示div并使用javascript登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自由,

我有这个小任务要执行。我想使用javascript / jquery实现登录门户。我的代码是这样的。





$(文件).ready(function(){

$ ('#dvSignIn')。hover(function(){

$('#dvLoginPortal')。css('display','block');

$( '#dvLoginPortal')。css('z-index','1000');



},function(){

$ ('#dLoginPortal')。css('display','none');

}

);

});











Hi frens,
I have this small task to perform. I want to implement a login portal using javascript/jquery. My code is like this.


$(document).ready(function () {
$('#dvSignIn').hover(function () {
$('#dvLoginPortal').css('display', 'block');
$('#dvLoginPortal').css('z-index', '1000');

}, function () {
$('#dvLoginPortal').css('display', 'none');
}
);
});





<div id="dvSignIn" style="vertical-align: middle; text-align: right; width: 95%">
                <a style="color: white;">Sign In</a>


                <form runat="server" id="frmLoginPortal">
                    <div style="display: none; vertical-align: middle;" id="dvLoginPortal">
                        <div>
                            Username:
                            <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
                        </div>
                        <div>
                            Password:
                            <asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
                        </div>
                        <div>
                            <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
                        </div>
                    </div>
                </form>
            </div>









我可以看到这个divLoginPortal但当我徘徊时然后div是不可见的,但我想使用这个div用户名和密码登录。如果鼠标悬停在divloginportal上,那么我想看到这个div并通过这里登录。我该怎么做才能帮帮忙!!!!





I can see this divLoginPortal but when i hover out then the div is invisible but i want to login using this div username and password. If mouse hovers over divloginportal, then i want to see this div and login through here. How can i do this please help out guys!!!!

推荐答案

(文件).ready(function(){
(document).ready(function () {


('#dvSignIn').hover(function(){
('#dvSignIn').hover(function () {


('#dvLoginPortal')。css('display','block') ;
('#dvLoginPortal').css('display', 'block');


这篇关于如何在div元素悬停时显示div并使用javascript登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆