【功能1】点击约谈按钮,弹出对话框和遮罩层(自己的叫法 专业叫法没有查)

【部分重点代码】

【下面的方法】

(1)获取系统时间如何实现(2)点击如何实现弹出窗口和遮罩层

 $(".date_now").click(function(){
$.ajax({
url:"/userCenter/getProject.jspx",
data:{"userId":"${currt.id}"},
success:function(result){
var obj=eval('('+result+')');
$("#pname").text(obj.pname);
}
})
//获取系统时间
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
$("#date").text(currentdate);
$("#marklayer,.modal").css("display","block");
});
$("a.close").click(function(){
$("#marklayer,.modal").css("display","none");
})

【tab切换】

页面效果

【主要代码】

     <div class="hc-eptd-main">
<div class="hc-eptd-list clearfix">
<ul>
<li class="on">投资人简介</li>
<li>投资机构简介</li>
<li>已投项目</li>
</ul>
</div>
<div class="eptd_box" style="display:block;">
<div class="eptd_profile">
<h2><i class="eptd_cj"></i>主要成就</h2>
<p>${user.bio}</p>
<h2><i class="eptd_fs"></i>联系方式</h2>
<p>邮箱:${user.email!''}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机:${user.mobile!''}</p>
</div>
</div> <div class="eptd_box" >
<div class="eptd_profile">
<h2><i class="eptd_mc"></i>机构名称:</h2>
<p>${user.cmsUserCompany.companyname}</p>
<h2><i class="eptd_jj"></i>公司简介</h2>
<p>${user.cmsUserCompany.companyintro}</p>
</div>
</div> <div class="eptd_box" >
<div class="eptd_project clearfix">
<ul>
[#list user.cmsProjects as project]
<li>
<div class="eptd-project-con">
<h2>${project.pname}</h2>
<div class="eptd_project_box">
<p><i class="eptd-icon01"></i>${project.org.name}</p>
<p><i class="eptd-icon02"></i>团队人数:${project.cmsProjectMembers?size}人</p>
<p><i class="eptd-icon03"></i>已进行${project.rztimes}轮融资</p>
</div>
</div>
<div class="eptd-project-img">
<a href="/projectDetail_${project.id}.jspx"><img src="${project.photourl}"/></a>
<p>${substring(project.pdescribe,200,'...')}</p>
</div>
</li>
[/#list] </div>
</div> </div>
【js代码】
$(".hc-eptd-list ul li").click(function(){
var index=$(this).index();
$(this).addClass("on").siblings().removeClass("on");
$(".hc-eptd-main .eptd_box").eq(index).css("display","block").siblings(".eptd_box").css("display","none")
})

【前端全部代码】

[#escape x as (x)!?html]
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>[#include 'inc_title.html'/]</title>
<meta name="keywords" content="${node.keywords}"/>
<meta name="description" content="${node.description}"/>
<link href="_files/css/common.css" rel="stylesheet"/>
<link href="_files/css/content.css" rel="stylesheet"/>
<link href="_files/css/hc-aim.css" rel="stylesheet">
[#include 'inc_js.html'/] <script>
$(function(){
$(".hd-nav ul li").removeClass("curr");
$(".banner-other").addClass("investor-banner"); $(".hc-eptd-list ul li").click(function(){
var index=$(this).index();
$(this).addClass("on").siblings().removeClass("on");
$(".hc-eptd-main .eptd_box").eq(index).css("display","block").siblings(".eptd_box").css("display","none")
})
$(".date_now").click(function(){
$.ajax({
url:"/userCenter/getProject.jspx",
data:{"userId":"${currt.id}"},
success:function(result){
var obj=eval('('+result+')');
$("#pname").text(obj.pname);
}
})
//获取系统时间
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
$("#date").text(currentdate);
$("#marklayer,.modal").css("display","block");
});
$("a.close").click(function(){
$("#marklayer,.modal").css("display","none");
}) }) function interview(){
var title=$("#title").val(),
msg=$("#msg").val(),
errorMessage=$(".errorMessage"); if(title==''){
errorMessage.html("约谈标题不能为空");
return;
} if(title.length>100){
errorMessage.html("约谈标题不能超过100字");
return;
} if(msg==''){
errorMessage.html("约谈内容不能为空");
return;
} if(msg.length>250){
errorMessage.html("约谈内容不能超过250字");
return;
} $("#marklayer,.modal").css("display","none");
$("#interForm").submit();
}
</script>
</head>
<body>
[#include 'inc_header.html'/]
[#include 'inc_pubbannel.html'/] <div class="hc-eptd-wrap comm">
<div class="bread-nav">
<ol class="fll">
<li><a href="/index_${org.id}.jspx">主页</a></li>
<li class="bread-sign"><span></span></li>
<li><a href="/investorList.jspx">投资人列表</a></li>
<li class="bread-sign"><span></span></li>
<li class="last">详情</li>
</ol>
</div>
<div class="hc-eptd-head">
<div class="eptd_info clearfix">
<div class="eptd_info_img">
<img src="${user.photourl}" onerror="javascript:this.src='images/peopleDefault.png';"/>
</div>
<div class="eptd_info_txt">
<h6>${user.realName}</h6>
<span class="eptd_iv">已投项目:<font>${user.cmsProjects?size}个</font></span>
<span class="eptd_iv">已投金额:<font>${price}万</font></span>
<span class="address">
<i class="location"></i>${user.comeFrom} <br />
<i class="industry"></i>
[#list user.cmsDomains as domain]
[#if domain.type==1]
${domain.name}&nbsp;&nbsp;
[/#if]
[/#list]
</span>
[#if currt??]
[#if currt.group.id==3]
<a href="javascript:" class="date_now">约谈</a>
[/#if]
[/#if]
</div>
</div> </div>
<div class="hc-eptd-main">
<div class="hc-eptd-list clearfix">
<ul>
<li class="on">投资人简介</li>
<li>投资机构简介</li>
<li>已投项目</li>
</ul>
</div>
<div class="eptd_box" style="display:block;">
<div class="eptd_profile">
<h2><i class="eptd_cj"></i>主要成就</h2>
<p>${user.bio}</p>
<h2><i class="eptd_fs"></i>联系方式</h2>
<p>邮箱:${user.email!''}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机:${user.mobile!''}</p>
</div>
</div> <div class="eptd_box" >
<div class="eptd_profile">
<h2><i class="eptd_mc"></i>机构名称:</h2>
<p>${user.cmsUserCompany.companyname}</p>
<h2><i class="eptd_jj"></i>公司简介</h2>
<p>${user.cmsUserCompany.companyintro}</p>
</div>
</div> <div class="eptd_box" >
<div class="eptd_project clearfix">
<ul>
[#list user.cmsProjects as project]
<li>
<div class="eptd-project-con">
<h2>${project.pname}</h2>
<div class="eptd_project_box">
<p><i class="eptd-icon01"></i>${project.org.name}</p>
<p><i class="eptd-icon02"></i>团队人数:${project.cmsProjectMembers?size}人</p>
<p><i class="eptd-icon03"></i>已进行${project.rztimes}轮融资</p>
</div>
</div>
<div class="eptd-project-img">
<a href="/projectDetail_${project.id}.jspx"><img src="${project.photourl}"/></a>
<p>${substring(project.pdescribe,200,'...')}</p>
</div>
</li>
[/#list] </div>
</div> </div>
</div> <div id="marklayer"></div>
<div class="pro-appoint modal">
<div class="modal-box">
<div class="modal-header">
<h3>约见</h3>
<a class="close"></a>
</div>
<div class="modal-body">
<form id="interForm" action="/userCenter/inverstor.jspx" method="post">
<input type="hidden" name="userId" value="${user.id}"/>
<table> <!-- <tr><td><span></span></td><td><p>${currt.cmsUserCompany.phone}</p></td></tr>-->
<tr><td class="hc-modal-tit"><span>创&nbsp;&nbsp;始&nbsp;&nbsp;人:</span></td><td><p>${(currt.realName)!''}</p></td></tr>
<tr><td class="hc-modal-tit"><span>联系方式:</span></td><td><p>${(currt.cmsUserCompany.phone)!''}</p></td></tr>
<tr><td class="hc-modal-tit"><span>日&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期:</span></td><td><p><div id="date"></div></p></td></tr>
<tr><td class="hc-modal-tit"><span>项目名称:</span></td><td ><div id="pname"></div></td></tr>
<tr><td class="hc-modal-tit">邀约简述:</td><td colspan="5"><input type="text" id="title" name="title"></td></tr>
<tr><td colspan="2"><textarea name="msg" id="msg" placeholder="邀约留言"></textarea></td></tr>
</table>
<div class="errorMessage" style="top:90%"></div>
</form>
</div> <div class="modal-footer">
<button onclick="interview();">发送信息</button>
</div>
</div>
</div> [#include 'inc_footer.html'/]
</body>
</html>
[/#escape]

js实现弹出窗口+遮罩层+tab切换的更多相关文章

  1. jquery弹出关闭遮罩层实例

    jquery弹出关闭遮罩层实例. 代码如下: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" & ...

  2. html+css源码之实现登录弹出框遮罩层效果

    在web开发中,很多网站都做了一些特别炫丽的效果,比如用户登录弹框遮罩层效果,本文章向大家介绍css如何实现登录弹出框遮罩层效果,需要的朋友可以参考一下本文章的源代码. html+css实现登录弹出框 ...

  3. [转]js来弹出窗口的详细说明

    1.警告对话框 <script> alert("警告文字") </script> 2.确认对话框 <script> confirm(" ...

  4. jquery-通过js编写弹出窗口

    本文转载 本文主要是通过js动态控制div的高度,css控制浮动 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional// ...

  5. 原生JS实现弹出窗口的拖拽

    上一篇说了一下弹出窗口功能的实现思路,一般情况下紧接着就会需要做到弹窗的移动,当然现在有很插件.库比如hammer可以使用,效率也非常好.但我觉得还是有必要了解一下原生JS的实现思路及方式,如下: 思 ...

  6. jQuery点击图片弹出大图遮罩层

    使用jQuery插件HoverTreeShow弹出遮罩层显示大图 效果体验:http://hovertree.com/texiao/hovertreeshow/ 在开发HoverTreeTop项目的产 ...

  7. 根据juery CSS点击一个标签弹出一个遮罩层的简单示例

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  8. jQuery弹出关闭遮罩层

    效果体验:http://keleyi.com/keleyi/phtml/jquery/9.htm 完整代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XH ...

  9. js实现弹出窗口、页面变成灰色并不可操作的例子

    function show() //显示隐藏层和弹出层 { var hideobj=document.getElementById("hidebg"); hidebg.style. ...

随机推荐

  1. netty4----netty5的客户端和服务端

    服务端: package com.server; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; ...

  2. json字符串转化为json对象and 对象转化为 json字符串

    第一种方法: var data =evel('('+jsonstr+')') 解析:  这种方法是常用的方法, 即动态执行 javascript代码 在堆中存放数据. 存在安全问题. 第二种方法:   ...

  3. rest_framework解析器组件源码流程

    rest_framework解析器组件源码流程 解析器顾名思义就是对请求体进行解析.为什么要有解析器?原因很简单,当后台和前端进行交互的时候数据类型不一定都是表单数据或者json,当然也有其他类型的数 ...

  4. 利用C#查看特定服务是否安装

    需求:想通过C#代码来查看IIS服务或者MSMQ是否已经安装 分析:IIS服务和MSMQ安装完成后都会创建windows服务,所以我们只需要查看对应的服务是否存在即可. 准备工作: IIS服务名称:W ...

  5. [转]React Native 语言基础之ES6

    React Native 是基于 React 这个前端框架来构建native app的架构.React Native基于ES6(即ECMAScript2015)语言进行开发的. JS的组成 1) 核心 ...

  6. Qt查找孩子findChild

    转载自[http://blog.csdn.net/liang19890820/article/details/52118210] 简述 在Qt编程过程中,通常会有多个部件嵌套,而大多数部件都有父子依赖 ...

  7. android timed gpio (linux 3.0.0) 受时钟控制的gpio【转】

    本文转载自:https://blog.csdn.net/linxi_hnh/article/details/8043417 1 路径: drivers/staging/android/timed_gp ...

  8. JMeter学习(二)工具简单介绍

    一.JMeter 介绍 Apache JMeter是100%纯JAVA桌面应用程序,被设计为用于测试客户端/服务端结构的软件(例如web应用程序).它可以用来测试静态和动态资源的性能,例如:静态文件, ...

  9. [nowcoder]青蛙

    链接:https://www.nowcoder.com/acm/contest/158/F 挺有意思的一道题,考场并查集忘记路径压缩就没AK== 很显然一个贪心是不,每只青蛙使劲往前跳,能跳多远跳多远 ...

  10. scala学习手记34 - trait方法的延迟绑定

    trait的方法的延迟绑定就是先混入的trait的方法会后调用.这一点从上一节的实例中也可以看出来. 下面再来看一个类似的例子: abstract class Writer { def write(m ...