Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.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
Javascript 为什么可以';我不能关闭我的表单,以便访问导航栏吗?_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript 为什么可以';我不能关闭我的表单,以便访问导航栏吗?

Javascript 为什么可以';我不能关闭我的表单,以便访问导航栏吗?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我需要能够关闭我的表单,或者使它不覆盖在html页面上(最好将它放在页面主体中),或者 我需要让我的表格上的“X”实际关闭表格,以允许访问导航栏 以下是我的HTML代码: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Will's Grill</title> <link href="styles.css" rel="styleshe

我需要能够关闭我的表单,或者使它不覆盖在html页面上(最好将它放在页面主体中),或者 我需要让我的表格上的“X”实际关闭表格,以允许访问导航栏

以下是我的HTML代码:

<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <title>Will's Grill</title>
  <link href="styles.css" rel="stylesheet" type="text/css">
  <!--The following script tag downloads a font from the Adobe Edge Web Fonts server for use within the web page. We recommend that you do not modify it.-->
  <script>
    var __adobewebfontsappname__ = "dreamweaver"
  </script>
  <script src="js/my.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
 </head>

<body>
  <header>
    <!--top navigation bar to guide the user thru the site-->
    <div class="nav">
      <ul>
        <li><a href="index.html">HOME</a></li>
        <li><a href="about.html">ABOUT WILL'S GRILL</a></li>
        <li><a href="menu.html">MENU</a></li>
        <li><a href="merch.html">MERCH</a></li>
        <li><a href="communitysupport.html">COMMUNITY SUPPORT</a></li>
        <li><a href="contact.html">CONTACT</a></li>
      </ul>
    </div>
  </header>
  <aside class="asidesection">
    <h2>Contact Will's Grill</h2>
  </aside>
  <section>
              <form action="comments.php" method="post">
        <div class="shade">
          <div class="blackboard">

            <div class="form">
              <span class="closeForm">&times;</span>
              <p>
                <label>Name: </label>
                <input type="text" name="name" />
              </p>
              <p>
                <label>Email: </label>
                <input type="text" name="email" />
              </p>
              <p>
                <label>Phone: </label>
                <input type="text" name="phone" />
              </p>
              <p>
                <label>Subject: </label>
                <input type="text" name="subject" />
              </p>
              <p>
                <label>Message: </label>
                <textarea name="message"></textarea>
              </p>
              <p>
                <input type="submit" value="send">
                <input type="reset" value="reset">
              </p>
            </div>
          </div>
        </div>
      </form>
  </section>
</body>
<footer>
  <!--bottom navigation bar to guide the user thru the site-->
  <div class="nav">
    <ul>
      <li><a href="index.html">HOME</a></li>
      <li><a href="about.html">ABOUT WILL'S GRILL</a></li>
      <li><a href="menu.html">MENU</a></li>
      <li><a href="merch.html">MERCH</a></li>
      <li><a href="communitysupport.html">COMMUNITY SUPPORT</a></li>
      <li><a href="contact.html">CONTACT</a></li>
    </ul>
  </div>
</footer>

</html>
以下是我的jQuery:

// All CSS except the concrete wall

$('.closeForm').click(function () {
    //close action
});

只需编辑您的js,如:

$('.closeForm').click(function () {
    $('.shade').hide();
});
$('.closeForm')。单击(函数(){
$('.shade').hide();
});
标题{
背景颜色:橙色;
宽度:100%;
身高:20%;
边界半径:25px;
}
身体{
背景:红色;
背景:线性梯度(140度,红色55%,黄色40%);
背景重复:重复-x;
背景颜色:黄色;
左缘:2%;
保证金权利:2%;
右边框颜色:黑色;
左边框颜色:黑色;
字体系列:Cambria,“Hoefler文本”,“解放衬线”,“泰晤士报”,“泰晤士报新罗马”,衬线;
字体风格:斜体;
字体大小:400;
颜色:#000000;
字体大小:大号;
}
美国海军{
列表样式类型:无;
填充:0;
宽度:100%;
}
李国荣先生{
浮动:左;
}
.导航{
宽度:100%;
文本对齐:居中;
垂直对齐:底部对齐;
显示器:flex;
边界半径:25px;
背景颜色:橙色;
溢出:隐藏;
高度:自动;
字体系列:Cambria,“Hoefler文本”,“解放衬线”,“泰晤士报”,“泰晤士报新罗马”,衬线;
}
李丽娜先生{
显示:内联块;
字体大小:25px;
利润率:20px;
线高:正常;
垂直对齐:超级;
填充:.5em;
右边框:1px实心#000000;
边界半径:.5;
颜色:黑色;
}
.nav ul a:聚焦{
颜色:红色;
边框颜色:红色;
}
1.亚洲区{
文本对齐:居中;
字体大小:xx大号;
}
.栏目{字体系列:“投石机MS”,Arial,Helvetica,无衬线;
字体大小:100%;
宽度:95%;
右边距:自动;
左边距:自动;
-moz列数:3;
-webkit列数:3;
列数:3;
}
a组{
文本缩进:50px;
}
.烧烤{
高度:400px;
宽度:500px;
浮动:左;
利润率:2%;
}
.文字{
背景:rgba(256、256、256、5);
边框:2倍纯色橙色;
边界半径:5px;
宽度:自动;
利润率:2%;
溢出:自动;
填充:1%;
}
img{
边界半径:20px;
边框颜色:透明;
边框样式:实心;
边框宽度:10px;
}
形式{
身高:100%;
背景:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/50598/concrete-wall-background.jpg)中心固定;
背景尺寸:封面;
}
.树荫{
溢出:自动;
位置:绝对位置;
排名:0;
左:0;
底部:0;
右:0;
背景图像:线性梯度(150度,rgba(0,0,0,0.65),透明);
}
.黑板{
位置:相对位置;
宽度:640px;
利润率:7%;
边框:棕褐色实心12px;
边框顶部:#bda27e实心12px;
左边框:#b19876实心12px;
边框底部:#c9ad86实心12px;
盒影:0px 0px 6px 5px rgba(58,18,13,0),0px 0px 0px 2px#c2a782,0px 0px 0px 4px#a58e6f,3px 4px 8px 5px rgba(0,0,0.5);
背景图像:径向梯度(左侧圆圈30%,rgba(34,34,34,0.3),rgba(34,34,34,0.3)80px,rgba(34,34,34,0.5)100px,rgba(51,51,51,0.5)160px,rgba(51,51,51,0.5)),线性梯度(215deg,透明,透明100px,#222 260px,#222 320px,透明),径向梯度(右侧圆圈,#111,rgba(51,51,51,1));
背景色:#333;
}
.黑板:在{
框大小:边框框;
显示:块;
位置:绝对位置;
宽度:100%;
身高:100%;
背景图像:线性渐变(175度,透明,透明40px,rgba(120,120,120,120,0.1)100px,rgba(120,120,120,120,0.1)110px,透明220px,透明),线性渐变(200度,透明80%,rgba(50,50,50,0.3)),径向渐变(右下椭圆,透明,透明200px,rgba(80,80,80,0.1)260px,rgba(80,80,80,0.1)320px,透明400px,透明);
边框:#2c2c实心2px;
内容:“联系我们”;
字体系列:“永久标记”,草书;
字体大小:2.2米;
颜色:rgba(2382382380.7);
文本对齐:居中;
填充顶部:20px;
}
.表格{
填充:70px 20px 20px;
}
p{
位置:相对位置;
边缘底部:1米;
}
标签{
垂直对齐:中间对齐;
字体系列:“永久标记”,草书;
字号:1.6em;
颜色:rgba(2382382380.7);
}
第n种类型(5)>标签{
垂直对齐:顶部;
}
输入,
文本区{
垂直对齐:中间对齐;
左侧填充:10px;
背景:无;
边界:无;
字体系列:“永久标记”,草书;
字号:1.6em;
颜色:rgba(2382382380.8);
线高:.6em;
大纲:无;
}
文本区{
高度:120px;
字号:1.4em;
线高:1米;
调整大小:无;
}
输入[type=“submit”]{
光标:指针;
颜色:rgba(2382382380.7);
线高:1米;
填充:0;
}
输入[type=“submit”]:焦点{
背景:rgba(2382382380.2);
颜色:rgba(2382382380.2);
}
:-moz选择{
背景:rgba(2382382380.2);
颜色:rgba(2382382380.2);
文本阴影:无;
}
::选择{
背景:rgba(2382382380.4);
颜色:rgba(2382382380.3);
文本阴影:无;
}
.closeForm{
颜色:白色;
字号:1.5em;
光标:指针;
位置:绝对位置;
右:10px;
顶部:5px;
}

威尔烤架
var\uuuu adobebfontsappname=“dreamweaver”
  • <
    $('.closeForm').click(function () {
        $('.shade').hide();
    });
    
      <script src="js/my.js"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
      <script src="js/my.js"></script>
    
    $('.closeForm').click(function () {
        //close action
    });
    
    $(document).ready(function () {
        $('.closeForm').click(function (event) {
            //close action
            console.log("Testing.");
        });
    });