自定义标签 加个五秒隐藏

面无表情王大锤 2017-01-05 05:34:35
这是一个自定义标签的代码,我全局很多地方用到,我需要给他加一个让他五秒后自动隐藏,但是我前端知识比较差不知道该咋加,有没有大神给个建议或者说个例子。

<%@ tag language="java" pageEncoding="UTF-8"%>
<%@ include file="/webpage/include/taglib.jsp"%>
<%@ attribute name="hideType" type="java.lang.String" required="false" description="显示类型"%><!-- 0:隐藏tip, 1隐藏box,不设置显示全部 -->
<%@ attribute name="content" type="java.lang.String" required="true" description="消息内容"%>
<%@ attribute name="type" type="java.lang.String" description="消息类型:info、success、warning、error、loading"%>
<script type="text/javascript">top.$.jBox.closeTip();</script>
<c:if test="${not empty content}">
<c:if test="${not empty type}">
<c:set var="ctype" value="${type}"/></c:if>
<c:if test="${empty type}">
<c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1?'success':'danger'}"/>
</c:if>
<c:if test="${hideType != '1'}">
<div id="messageBox" class="alert alert-${ctype}">
<button data-dismiss="alert" class="close">×</button>${content}</div>
</c:if>
<c:if test="${hideType != '0'}">
<script type="text/javascript">if(!top.$.jBox.tip.mess){top.$.jBox.tip.mess=1;top.$.jBox.tip("${content}","${ctype}",{persistent:true,opacity:0});$("#messageBox").show();}</script>
...全文
115 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_33065723 2017-01-05
  • 打赏
  • 举报
回复
楼主傻不傻,我是他 (( /|_/| \\.._.' , ,\ /\ | '.__ v / (_ . / " ) _)._ _ / '.\ \|( / ( '' ''\\ \\
12312312312wwqeqw 2017-01-05
  • 打赏
  • 举报
回复
<script> setTimeout(function() { $("#messageBox").hide(); },5000);//定时时间5000毫秒 </script>
12312312312wwqeqw 2017-01-05
  • 打赏
  • 举报
回复
垃圾垃圾驱蚊器翁群翁

87,902

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧