js实现弹出窗口+遮罩层+tab切换
【功能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!''} 手机:${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}
[/#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!''} 手机:${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>创 始 人:</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>日 期:</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切换的更多相关文章
- jquery弹出关闭遮罩层实例
jquery弹出关闭遮罩层实例. 代码如下: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" & ...
- html+css源码之实现登录弹出框遮罩层效果
在web开发中,很多网站都做了一些特别炫丽的效果,比如用户登录弹框遮罩层效果,本文章向大家介绍css如何实现登录弹出框遮罩层效果,需要的朋友可以参考一下本文章的源代码. html+css实现登录弹出框 ...
- [转]js来弹出窗口的详细说明
1.警告对话框 <script> alert("警告文字") </script> 2.确认对话框 <script> confirm(" ...
- jquery-通过js编写弹出窗口
本文转载 本文主要是通过js动态控制div的高度,css控制浮动 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional// ...
- 原生JS实现弹出窗口的拖拽
上一篇说了一下弹出窗口功能的实现思路,一般情况下紧接着就会需要做到弹窗的移动,当然现在有很插件.库比如hammer可以使用,效率也非常好.但我觉得还是有必要了解一下原生JS的实现思路及方式,如下: 思 ...
- jQuery点击图片弹出大图遮罩层
使用jQuery插件HoverTreeShow弹出遮罩层显示大图 效果体验:http://hovertree.com/texiao/hovertreeshow/ 在开发HoverTreeTop项目的产 ...
- 根据juery CSS点击一个标签弹出一个遮罩层的简单示例
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- jQuery弹出关闭遮罩层
效果体验:http://keleyi.com/keleyi/phtml/jquery/9.htm 完整代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XH ...
- js实现弹出窗口、页面变成灰色并不可操作的例子
function show() //显示隐藏层和弹出层 { var hideobj=document.getElementById("hidebg"); hidebg.style. ...
随机推荐
- 利用ntp自动同步时间
实验环境:centos 6.10 1.安装ntp工具 yum install -y ntp 2.便宜/etc/ntp.conf文件,添加远程时间服务器 server ntp1.aliyun.com s ...
- CMD 配置静态IP与DNS
配置静态IP与DNS # 修改IP netsh interface ip set address "网络连接" static IP地址 子网掩码 默认网关 # 修改DNS nets ...
- 【纯代码】Swift相册照片选择-支持单选或多选
// // NAPublishAlbumTableViewController.swift //// // Created by on 2019/3/23. // Copyright © 2019年 ...
- git多站点帐号配置
事件场景 小明同学是一个非常努力的coder,业余时间都花在了github.com上面,因为公司的台式机性能比较好,小明同学想在公司电脑上面也进行开发.但是github上面的帐号邮箱跟公司分配的帐号邮 ...
- 《大型网站系统与JAVA中间件实践》读书笔记-数据访问层
数据访问层 5.1.2数据库垂直/水平拆分的困难 随着网站业务的快速发展,数据量和访问量不断上升,数据库的压力越来越大. 更换更好的硬件(Scale Up)是一种解决方案,而且在我们能付得起硬件费用并 ...
- Can't bind multiple parameters ('header' and 'parameters') to the request's content.
2019-01-23 15:46:29.012+08:00 ERROR [6]: System.InvalidOperationException: Can't bind multiple param ...
- python 读取libsvm文件
以下三种方式 # -*- coding:utf-8 -*- import numpy as np import os from sklearn import datasets def data_gen ...
- 用Heartbeat实现HA集群
HA即高可用(high avaliable),又被叫做双机热备,用于关键性业务,简单理解就是,有两台机器A和B,正常是A提供服务,B待机闲置,当A宕机或服务宕掉,会切换到B机器继续提供服务.常用实现高 ...
- HTML5 地理定位 【来自百度应用分享平台】
百度给的地图API接口相当完善,复制过来一下,以后备用 基本使用方法: <!--引入百度地图API--> <scriptsrc="http://api.map.baidu. ...
- 用WebClient在异步下载或上传时每次只进行一个任务 C#
当在每次上传或者下载的时候,我只想进行一个任务的,我用的是WebClient类,但是我又不想用同步的方法UploadFile.DownloadFile,因为WebClient这个类的同步方法没有Upl ...