這裏簡略貼下項目目錄結構,請根據實際狀況應用php
案例連接下載https://pan.baidu.com/s/1kVcsmQ7css
<iframe name="right" id="rightMain" src="" frameborder="false" scrolling="auto" style="overflow-x:hidden;border:none;" width="100%" height="auto" allowtransparency="true" class="111"></iframe> <div class="tipfloat"> <h2 class="tiphead"><strong>消息提示框</strong><span title="關閉" class="close"><img src="__PUBLIC__/admin/yuyue_manage/error.png"/></span></h2> <div class="ranklist"> <ol id="ranklist"> <li class="top"></li> </ol> <div style="display: none;"> <audio id="im_ring" src="__PUBLIC__/admin/yuyue_manage/ring.mp3"></audio> <input type="hidden" id="opentip_num" value="on" /> </div> </div> </div>
checkmsg(); function checkmsg() { var url = "index.php?s=/Admin/public/ajax_box.html"; $.ajax({ type: "GET", url: url, dataType: "json", success: function(msg) { var num = msg; var opentip_num = $('#opentip_num').val(); if (num != opentip_num) { html = ''; $.each(msg, function(i, data) { html += '<li class="top"><p>' + data + '</p></li>'; }) opentipwindow(num, html); } } }); setTimeout(function() { checkmsg(); }, 10000); } function opentipwindow(num, str) { document.getElementById('im_ring').play(); $('#ranklist').html(str); var titHeight = $("tiphead").height(); $(".tipfloat").show(); // $(".tipfloat").css('height',196); $(".tipfloat").css('height', 150); $(".close").click(function() { $(".tipfloat").animate({ height: titHeight - 50 }, 1000, function() { $(".tipfloat").hide(); }); }); } function openwindowleft(targetUrl) { $('#loading').show(); var titHeight = $("tiphead").height(); $(".tipfloat").animate({ height: titHeight - 50 }, 1000, function() { $(".tipfloat").hide(); }); $("#rightMain").attr('src', targetUrl); }
yuyue_manage下就是圖片啦html
PublicController.class.phpajax
public function ajax_box() { $info = I('ex'); $id = session('admin_id'); $map['status'] = 1; $count = M('OrderInfo')->where($map)->count(); $where_g['status'] = 0; $goods = M('Goods')->where($where_g)->count(); $where_sh['status'] = 0; $shops = M('Shops')->where($where_sh)->count(); //$where_jie['money_status'] = 0; $where_jie['status'] = array('GT', 0); // pe($where_jie); $order = M('OrderInfo')->where($where_jie)->count(); $data['count'] = '<a onclick="openwindowleft(\'' . U('OrderInfo/index') . '\')">新訂單' . $count . '個</a>'; $data['goods'] = '<a onclick="openwindowleft(\'' . U('Audit/goods') . '\')">未審覈商品' . $goods . '個</a>'; $data['shops'] = '<a onclick="openwindowleft(\'' . U('Audit/index') . '\')">未審覈店鋪' . $shops . '個</a>'; $data['order'] = '<a onclick="openwindowleft(\'' . U('OrderInfo/index') . '\')">訂單列表' . $order . '個</a>'; $this->ajaxReturn($data); }