[TOC]
>apicloud中可以引用jq文件 ,經試驗layer彈窗插件不可用
> 可使用jeBox彈窗,(jeBox不包含任何第三方庫,原生js開發)
**注**:jq文件版本不能太高
# 點擊縮略圖顯示大圖
## 代碼
~~~
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>機構信息</title>
<link rel="stylesheet" type="text/css" href="../css/aui.css"/>
<style>
body {
height: auto;
}
.aui-card {
margin-top: 15px;
}
.aui-badge {
background-color: transparent;
color: #666;
font-size: 14px;
}
.aui-input-row .check {
padding: 8px;
color: #f1c40f;
}
.avatar {
margin-top: 13px;
}
.content {
position: absolute;
top: 50%;
right: 30px;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
display: inline-block;
padding: 3px 6px;
font-size: 16px;
line-height: 1;
color: #333;
border-radius: 100px;
}
.check {
margin-top: 8px;
}
.maxImg{
position: fixed;
top: 25%;
left:0%;
z-index: 1002;
}
.maxImg #Images{
width: 100%;
}
#goodcover {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 133%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.8;
opacity: 0.50;
filter: alpha(opacity=80);
}
</style>
</head>
<body>
<div class="aui-content aui-card aui-noborder">
<ul class="aui-user-view my_info" id="organInfo">
</ul>
</div>
<div id="goodcover" onclick="clos();"></div>
<div class="maxImg">
<img src="" id="Images">
</div>
</body>
<script type="text/javascript" src="../script/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/doT.min.js"></script>
<script type="text/javascript" src="../script/jebox.min.js"></script>
<!-- <script type="text/javascript" src="../script/layer.js"></script> -->
<script type="text/x-dot-template" id="OrganInfoT">
<li class="aui-list-view-cell" >
<a class="">機構名稱 <span class="content" id="organ_name">{{=it.organ_name}}</span> </a>
</li>
<li class="aui-list-view-cell" >
<a class="">所屬分類 <span class="content" id='organ_cate'>{{=it.cate_name}}</span></a>
</li>
<li class="aui-list-view-cell" >
<a class=""> 機構電話 <span class="content" id="birthday" >{{=it.tel}}</span> </a>
</li>
<li class="aui-list-view-cell" >
<a class="">聯系人 <span class="content" id="realname">{{=it.realname}}</span></a>
</li>
<li class="aui-list-view-cell" >
<a class="">加入時間 <span class="content" id="telphone">{{=it.create_time}}</span></a>
</li>
<li class="aui-list-view-cell" >
<a class="">所在區域 <span class="content" id='region'>{{=it.province_name}}-{{=it.city_name}}-{{=it.district_name}}</span> </a>
</li>
<li class="aui-list-view-cell" >
<a class=""> 詳細地址 <span class="content" id="address">{{=it.addr}}</span> </a>
</li>
<li class="aui-user-view-cell aui-img" onclick="max('quali');">
<img class="aui-img-object aui-pull-right" id='quali' src="{{=it.qualification}}" style=" margin-right: 27px">
<div class="aui-img-body ">
<h2 class='avatar'>營業執照</h2>
</div>
</li>
<li class="aui-user-view-cell aui-img" >
<img class="aui-img-object aui-pull-right" id='qualification1' src="http://www.sytest.com.cn/data/upload/{{=it.idphoto1}}" style=" margin-right: 27px" onclick="max('qualification1');">
<img class="aui-img-object aui-pull-right" id='qualification2' src="http://www.sytest.com.cn/data/upload/{{=it.idphoto2}}" style=" margin-right: 27px" onclick="max('qualification2');">
<div class="aui-img-body ">
<h2 class='avatar'>證件照</h2>
</div>
</li>
<li class="aui-user-view-cell aui-img" onclick="max('avatarImg');">
<img class="aui-img-object aui-pull-right" id='avatarImg' src="{{=it.logo}}" style=" margin-right: 27px">
<div class="aui-img-body ">
<h2 class='avatar'>機構頭像</h2>
</div>
</li>
</script>
<script type="text/javascript">
function max(url){
var ourl = document.getElementById(url).src;
document.getElementById("Images").src = ourl;
$('#maxImg').center();
$('#goodcover').show();
$('#Images').fadeIn();
}
function clos(){
$('#Images').hide();
$('#goodcover').hide();
}
/*function max(price){
jeBox.open({
padding:"0",
area:["50%","80%"],
content: document.getElementById(price),
masklock : true
})
}*/
apiready = function(){
api.parseTapmode();
var organ_id = api.pageParam.organ_id;
fnLoadData(organ_id);
jQuery.fn.center = function(loaded) {
var obj = this;
body_width = parseInt($(window).width());
body_height = parseInt($(window).height());
block_width = parseInt(obj.width());
block_height = parseInt(obj.height());
left_position = parseInt((body_width / 2) - (block_width / 2) + $(window).scrollLeft());
if (body_width < block_width) {
left_position = 0 + $(window).scrollLeft();
};
top_position = parseInt((body_height / 2) - (block_height / 2) + $(window).scrollTop());
if (body_height < block_height) {
top_position = 0 + $(window).scrollTop();
};
if (!loaded) {
obj.css({
'position': 'absolute'
});
obj.css({
'top': ($(window).height() - $('#maxImg').height()) * 0.5,
'left': left_position
});
$(window).bind('resize', function() {
obj.center(!loaded);
});
$(window).bind('scroll', function() {
obj.center(!loaded);
});
} else {
obj.stop();
obj.css({
'position': 'absolute'
});
obj.animate({
'top': top_position
}, 200, 'linear');
}
}
}
// 顯示數據
function fnShowData(data_){
var apendText = $api.byId('OrganInfoT').text;
var fnapendText = doT.template(apendText);
var html = fnapendText(data_);
var list = $api.dom('#organInfo');
api.parseTapmode();
$api.append(list, html);
api.hideProgress();
}
// 加載數據
function fnLoadData(organ_id){
api.ajax({
url: 'http://www.sytest.com.cn/index.php?g=Osapp&m=OrganManage&a=organ_info',
method: 'post',
data: {
values: {
organ_id: organ_id
}
}
},function(ret, err){
if (ret) {
// alert( JSON.stringify( ret ) );
fnShowData(ret);
} else {
alert( JSON.stringify( err ) );
}
});
}
</script>
</html>
~~~
## 效果

- 關于我們
- ApiCloud
- 支付模塊
- 微信支付--wxPay(客戶端)
- 微信支付--wxPay(服務端)
- 支付寶支付--aliPay(客戶端配置)
- 支付寶支付--aliPay(服務端配置)
- DoT模板
- 緩存模塊
- 監聽模塊
- 百度定位模塊
- 設置狀態欄字體顏色
- 選擇城市插件
- 跨頁面執行方法
- 安卓-點擊返回事件
- 上傳圖片模塊
- 點擊彈出放大圖片層
- 魅族手機apiready問題
- 分享
- 跨win或frm執行腳本
- 關于ios數字自動識別成手機號
- 百度地圖bMap
- 語音識別模塊
- tabBarMenu底部導航
- 第三方登錄
- QQ網站和appQQ賬號的統一問題解決
- 微信登錄
- QQ登錄
- 微博登錄
- 上拉加載、下拉刷新模塊
- 圖片緩存
- 文件和圖片緩存機制分享
- PHP
- 支付寶及時到賬
- no input file specified報錯解決
- thinkphp 整合kindeditor
- 整合tpshop微信模塊到thinkcmf中
- thinkphp3.1.3整合支付寶
- 網站接入QQ OAuth2.0登錄教程
- ThinkPHP整合百度編輯器Ueditor
- PHP加快執行效率的寫法規范
- ThinkPHP操作大全
- PHP操作大全
- Thinkphp中SQL操作返回值
- php5.3 foreach 使用&(與運算符)引用賦值要注意的問題
- mysql給字段追加值
- 阿里大魚短信平臺接入
- Navicat 導出 Mysql 數據字典
- php 面向對象全面教程
- PHP5下調用SOAP
- PHP處理時間格式添加空格
- 偽裝URL請求(.htaccess)
- url請求參數加解密
- JS插件
- artDialog彈窗-頁面傳值
- jQuery點擊遮罩彈出層固定居中
- jeBox原生彈窗
- bxslider輪播
- js生成指定位數隨機數
- 發送短信倒計時
- js調試
- jQuery.validator 表單驗證規則
- Swiper 輪播
- 獲得焦點時-圖片抖動
- uploadify無刷新上傳圖片
- 導航下拉隱藏上拉顯示
- 獲得焦點時-加黑色蒙版
- jquery.qrcode.js生成二維條形碼(支持中文)
- jquery.qrcode.js生成二維條形碼(官方不支持中文)
- nth-child 選擇器
- 無刷新點擊實現加載更多數據
- 刷新頁面方法
- 判斷滾動條向上向下
- 跨瀏覽器復制jQuery-zclip
- js校驗表單后提交表單的三種方法
- 用JS判斷下拉框是否選中
- div中滾動
- 提交時彈出模態框
- 當圖片不顯示時替換方法
- 前端
- CSS3
- HTML5
- css技巧
- 移動端rem
- Flex布局
- 電商詳情滾動條監聽
- VueCircleMenu圓環按鈕
- iframe自適應頁面高度
- 百度Echart
- input:radio改變選中顏色
- Jquery
- 響應式布局基本實現Media Query
- 循環輸出只輸出新內容
- 小程序
- wx.request坑
- 概要
- git操作
- 本地記住密碼
- 操作
- 生成ssh公鑰 記住密碼
- git避坑
- ES6學習手札
- 調試小插件
- 谷歌插件Postman
- PHP調試助手
- WordPress
- 緩存服務器Redis
- 在線代碼運行 Docker
- 在ubuntu下怎樣安裝https
- BrowserSync 瀏覽器同步測試工具
- getmarkman高效的設計稿標注、測量工具
- PHPstrom軟件
- 服務器
- linux 安裝搭建服務器配置及nginx配置
- tpshop的nginx 服務器配置方法
- (服務器訪問文件404解決辦法)IIS 之 添加MIME擴展類型及常用的MIME類型列表
- mysql部分
- mysql緩存
- MySql監控工具--mytop
- MySql主從搭建
- mysql優化
- Mysql 復制 (主從復制)
- iOS開發筆記 - 上線流程
- VUE避坑指南
- 從零開始學Vue
- Vue-cli
- Webpack
- VUE小記
- npm打包空白
- 打包背景圖片/項目圖片不顯示
- VUE避坑指南/elementUI upload 自定義http-request上傳
- 關于watch監聽路由重復加載方法
- 解決加載內容的時候閃動問題
- vuecli沒有network訪問地址
- python學習
- python初始
- pytho內置函數大全
- win10 播放器播放TS文件問題
- 設計網站
- VUE避坑指南/VUE-CLI部署空白
- swiper使用問題
- uni-app學習手冊
- 目錄結構
- layUI
- nodesass版本sassloader版本問題