首页 > 其他 > 详细

学习进度

时间:2020-03-21 03:38:14      阅读:49      评论:0      收藏:0      [点我收藏+]

layui给元素绑定事件:

技术分享图片
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>


<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layer-更懂你的web弹窗解决方案</title>

  <style>
  html{background-color:#E3E3E3; font-size:14px; color:#000; font-family:‘微软雅黑‘}
  a,a:hover{ text-decoration:none;}
  pre{font-family:‘微软雅黑‘}
  .box{padding:20px; background-color:#fff; margin:50px 100px; border-radius:5px;}
  .box a{padding-right:15px;}
  #about_hide{display:none}
  .layer_text{background-color:#fff; padding:20px;}
  .layer_text p{margin-bottom: 10px; text-indent: 2em; line-height: 23px;}
  .button{display:inline-block; *display:inline; *zoom:1; line-height:30px; padding:0 20px; background-color:#56B4DC; color:#fff; font-size:14px; border-radius:3px; cursor:pointer; font-weight:normal;}
  .photos-demo img{width:200px;}
  </style>
  <script src="jquery-1.8.3.min.js"></script> 
  <script src="../layer-v3.1.1/layer/layer.js"></script>
</head>
<script>
function panduan2(id)
{
      
      var num=document.getElementById("a").value;
      if(num==0){
          layer.confirm(你还未登录,无法进行操作,请先去登录, {icon: 5, title:提示}, function(index){
              window.location.href="index2.jsp";//还未登录跳转到登录页面
              layer.close(index);
            });
      }
      else
          {
    window.location.href=("contact2.jsp?place="+id);//登录成功后需要跳转的页面加参数
          }
}
</script>
<body>
<%
String loginname="";
int a=0;
if(session.getAttribute("username")==null){
    loginname="error";
}else
{
    loginname=(String)session.getAttribute("username");
    a=1;
}
%>
<input type="hidden" id="a" value="<%=a%>">
<div class="box" style="text-align:center">
  <a onclick="panduan2(‘oo‘)" id="about">验证</a>
</div>
</body>
</html>
View Code

 

学习进度

原文:https://www.cnblogs.com/zhao-teng-ass/p/12535459.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!