悬停中的文本字段在IE中无法正常工作

问题描述 投票:8回答:3

我在IE中进行开发时遇到了麻烦,我已经制作了一个很好的标题,但现在我在Internet Explorer中查看了所有内容,我发现了一些错误,

一个是以下,我从来没有这样的事情,这就是为什么我真的迷恋这个问题。我甚至不确定是否有人知道如何解决这个问题,接受挑战!

我知道占位符DOESNT在IE中工作,但这显然不是问题。如果你在悬停中,并且你正在浏览文本字段,那么该框就会消失,你需要再次检查它。

这里有一些代码:

<ul>
    <div class="transparant">
        <div class="dropbox">
            <div class="login">
                <div class="textfield">
                     <form method="post">
                       <input id="textfield_post" type="text" name="username" placeholder="Gebruikersnaam" class="matrix"/>    
                </div>
            </div>

            <div class="pass">
                <div class="textfield">
                    <input id="textfield_post" type="password" name="password" placeholder="Wachtwoord" class="matrix"/>   
                </div>
            </div>

            <div class="loginbutton">   
                <input type="submit" class="btn" value= "Login" type="button" id="login_button"></form>
            </div>

            <div class="forgotpass">
                <a href="#" onclick="NewPassword()">Forgot password?</A>
            </div>
        </div>
    </div>
    </div>
</ul>

我认为这是因为z-index。此外,我不想使用jquery或任何东西,我只是想使用正确的HTML和CSS解决问题。

我问你是否有人熟悉这个问题,

网站:(仅限IE 7和8)

谢谢阅读;)

html css internet-explorer
3个回答
5
投票

清空文本框时,问题就解决了。我不知道你是否接受这项工作,但嘿,它的工作:)


3
投票

我想你使用:hover CSS或mouseover() JQuery来显示框。我建议使用mouseentered()检查以下链接:

http://www.mkyong.com/jquery/different-between-mouseover-and-mouseenter-in-jquery/

并确保制作ul overflow:hidden


1
投票

IE目前不支持Placeholder.i建议你移动JQuery。这是示例代码

<p><script type="text/javascript">
    $(function () {
        if (!$.support.placeholder) {
            var active = document.activeElement;
            $(':text').focus(function () {
                if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
                    $(this).val('').removeClass('hasPlaceholder');
                }
            }).blur(function () {
                if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
                    $(this).val($(this).attr('placeholder')).addClass('hasPlaceholder');
                }
            });
            $(':text').blur();
            $(active).focus();
        }
    });
</script>
</p>

希望能帮助到你

© www.soinside.com 2019 - 2024. All rights reserved.