1. 程式人生 > >公告顯示為提示層

公告顯示為提示層

頁面 con cti logs 彈出 提示 .text area child

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>開始使用layer</title>
<script type="text/javascript" src="http://www.cpw998.com/c9/Public/static/js/lib/jquery.min.js"></script>
<script type="text/javascript" src="http://www.cpw998.com/c9/Public/static/layer/layer.js"></script>
<script>
//彈出一個頁面層
//彈出一個頁面層
$(document).ready(function(){
	$(".info_title").click(function(){
		ggtitle=$(this).children("#ggtitle").text();
		infoCnt =$(this).siblings(".info_cnt").text();
	  layer.open({
	  type: 1,
	  area: [‘600px‘, ‘360px‘],
	  shadeClose: true, //點擊遮罩關閉
	  title:ggtitle,
	  content: ‘\<\div style="padding:20px;">‘+ infoCnt +‘\<\/div>‘
	  });
		
	});	
});

</script>
</head>
<body>

<div class="info_title">ddd<span id="ggtitle">提示標題</span></div>
<div class="info_cnt" style="display:none;"><b>hello word</b></div>
</body>
</html>

  

公告顯示為提示層