Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery显示php echo中隐藏的Div_Php_Jquery_Css - Fatal编程技术网

Jquery显示php echo中隐藏的Div

Jquery显示php echo中隐藏的Div,php,jquery,css,Php,Jquery,Css,我在这里挣扎。。需要帮助!!:) 我有一个PHP,需要运行一个jquery。按下submit按钮时在echo中显示。。任何帮助都将不胜感激 PHP代码> <?php $name = $_POST['name']; $email = $_POST['email']; $title = $_POST['title'];

我在这里挣扎。。需要帮助!!:)

我有一个PHP,需要运行一个jquery。按下submit按钮时在echo中显示。。任何帮助都将不胜感激

PHP代码>

<?php
                        $name = $_POST['name'];
                        $email = $_POST['email'];
                        $title = $_POST['title'];
                        $content = $_POST['content'];
                        $from = 'From: Comeone Form'; 
                        $to = 'info@someemail.com'; 
                        $subject = 'Contact Form';
                        $human = $_POST['human'];

                        $body = "From: $name\n E-Mail: $email\n Subject: $title\n Message:\n $content";

                    if ($_POST['submit'] && $human == '4') {                 
                    if (mail ($to, $subject, $body, $from)) { 
                            echo '<p>Your email has been successfully sent!</p>';
                    } else { 
                            echo '<p>Something went wrong, go back and try again!</p>'; 
                            } 
                    } else if ($_POST['submit'] && $human != '4') {
                            echo '<script>
$("submit-mail").click(function () {
$("#mail-message-window").show("slow");
});
</script>';
                            }
                    ?>
而不是

$("#mail-message-window").show("slow");
你需要

$("#mail-message").show("slow");
因为从
CSS
看来
显示:无设置为
#邮件消息
,但不设置为
邮件消息窗口

如果要使用
$(#邮件消息窗口”).show(“slow”)
然后将
显示:无
设置为
#邮件消息窗口
,而不是
#邮件消息

注 您应该使用
$(document).ready(function(){…})
,简而言之
$(function(){…})
来包装所有jQuery代码

#mail-message
{
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    width: 100%;
    height: 100%;
    z-index: 210;
}
#mail-message
{
    width: 100%;
    height: 100%;
    text-align: center;
}
#mail-message-window
{
    width: 400px;
    padding-bottom: 20px;
    border: solid 0px #ffffff;
    background: #000000 url('../images/bg.png') repeat top left;
    margin: 0 auto;
}
#mail-message-header
{
    width: 400px;
    height: 70px;
}
.mail-message-success
{
    background: transparent url('../images/success.png') no-repeat top left;
}
.mail-message-error
{
    background: transparent url('../images/error.png') no-repeat top left;
}
#mail-message-window p
{
    margin: 0 0 5px 10px;
    text-align: left;
}
#mail-message-window input
{
    margin-top: 10px;
}
#mail-message td
{
    vertical-align: middle;
}
$("#mail-message-window").show("slow");
$("#mail-message").show("slow");