目標(biāo):根據(jù)后臺(tái)定義的全局變量值(某一產(chǎn)品ID)前臺(tái)頁(yè)面自定開啟該產(chǎn)品的彈窗
效果圖:
function getPopProduct(){ $poproID = $GLOBALS['pop_product']; if(!empty($poproID) && $GLOBALS['pop_product'] != 0){ $row = GetOneArchive($poproID); $poproTit = $row['title']; $poproUrl = $row['arcurl']; $poproDesc = $row['description']; $poproPic.= "<img WIDTH=250px; height=250px; src=".$row['litpic']." />"; $popInfo .="<p class=pop><p class=pop_left>"; $popInfo .= $poproPic."</p><p class=pop_right><span class=pop_title>".$poproTit."</span><p>".$poproDesc."</p><p class=pop_right3><a href=".$poproUrl." target=_blank>了解詳情>></a></p></p>"; }else{ $popInfo = ""; } echo $popInfo; }
a、在<body>之前插入以下代碼
{dede:php} if(!empty($GLOBALS['pop_product']) && $GLOBALS['pop_product'] != 0){ echo "<SCRIPT language='javascript' type='text/javascript' src='/templets/default/js/jquery.artDialog.min.js'></SCRIPT>"; echo "<SCRIPT language='javascript' type='text/javascript' src='/templets/default/js/artDialog.plugins.min.js'></SCRIPT>"; echo "<!--[if gte IE 7]><!--><LINK rel='stylesheet' type='text/css' href='/templets/default/js/simple.css'><!--<![endif]--><!--[if lt IE 7]><link href=/templets/default/js/default.css /><![endif]-->"; } {/dede:php} <script type="text/javascript" charset="utf-8"> $(function() { $.dialog({width: '600px', lock:true, zIndex: 9999, drag:true, title:'最新產(chǎn)品推薦', background:'#600', opacity: 0.47, esc:true, content: document.getElementById('pop') }); }); </script>
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: dedecms首頁(yè)彈出推薦產(chǎn)品彈窗