码迷,mamicode.com
首页 > Web开发 > 详细

php 操作提示框

时间:2016-11-03 11:29:46      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:script   else   containe   text   relative   size   sla   cat   position   

/**
     * 跳转
     * @param type $msg
     * @param type $url
     */
    protected function jump($msg, $url)
    {
        $html = <<<EOF
<!DOCTYPE html>
<html lang="en">
	<head><title>提示</title></head>
	<style>
body {
  font-size: 100%;
  font-family: "Lato", sans-serif;
  color: #8f9cb5;
  background-color: #ffd88f;
}
.cd-popup {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(94, 110, 141, 0.9);
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.3s 0s, visibility 0s 0.3s;
  -moz-transition: opacity 0.3s 0s, visibility 0s 0.3s;
  transition: opacity 0.3s 0s, visibility 0s 0.3s;
}
.cd-popup.is-visible {
  opacity: 1;
  visibility: visible;
  -webkit-transition: opacity 0.3s 0s, visibility 0s 0s;
  -moz-transition: opacity 0.3s 0s, visibility 0s 0s;
  transition: opacity 0.3s 0s, visibility 0s 0s;
}

.cd-popup-container {
  position: relative;
  width: 90%;
  max-width: 400px;
  margin: 4em auto;
  background: #FFF;
  border-radius: .25em .25em .4em .4em;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  -webkit-transform: translateY(-40px);
  -moz-transform: translateY(-40px);
  -ms-transform: translateY(-40px);
  -o-transform: translateY(-40px);
  transform: translateY(-40px);
  /* Force Hardware Acceleration in WebKit */
  -webkit-backface-visibility: hidden;
  -webkit-transition-property: -webkit-transform;
  -moz-transition-property: -moz-transform;
  transition-property: transform;
  -webkit-transition-duration: 0.3s;
  -moz-transition-duration: 0.3s;
  transition-duration: 0.3s;
}
.cd-popup-container p {
  padding: 1em 1em;
}
	</style>
	<body>
		<div class="cd-popup is-visible" role="alert">
			<div class="cd-popup-container">
				<p>{$msg}</p>
				<span id="time" style="background: red;">3</span>
				秒后自动跳转,如不跳转,请点击:<a href="{$url}">{$msg}</a>
			</div> <!-- cd-popup-container -->
		</div> <!-- cd-popup -->
		
		<script  type="text/javascript">
		
				delayURL("{$url}");
				
				function delayURL(url) {
					var delay = document.getElementById("time").innerHTML;
					if (delay > 0) {
						delay--;
						document.getElementById("time").innerHTML = delay
					} else {
						window.top.location.href = url
					}
					setTimeout("delayURL(‘" + url + "‘)", 1000)
				}

		</script>
	</body>
</html>
EOF;
        echo $html;die;
    }

  

php 操作提示框

标签:script   else   containe   text   relative   size   sla   cat   position   

原文地址:http://www.cnblogs.com/xyyphp/p/6025871.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!