<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4"></script>
<script type="text/javascript">
// 百度地图API功能
var map = new BMap.Map("map");
map.centerAndZoom(new BMap.Point(108.354387,22.79029),19);
var marker1 = new BMap.Marker(new BMap.Point(108.354387,22.79029)); //创建标注
map.addOverlay(marker1); // 将标注添加到地图中
//创建信息窗口
var infoWindow1 = new BMap.InfoWindow("广西宏越钢结构工程有限公司<br>电话:0771-5387865<br>地址:广西南宁市青秀区柳沙路8号");
marker1.addEventListener("click", function(){this.openInfoWindow(infoWindow1);});
</script>
Run code
Cut to clipboard
#,广西南宁市,2017-12-05,14:47:31, 点击收藏js按钮
function addFavorite() {
var url = window.location;
var title = document.title;
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("360se") > -1) {
alert("由于360浏览器功能限制,请按 Ctrl+D 手动收藏!");
}
else if (ua.indexOf("msie 8") > -1) {
window.external.AddToFavoritesBar(url, title); //IE8
}
else if (document.all) {
try{
window.external.addFavorite(url, title);
}catch(e){
alert('对不起,由于您的浏览器功能限制,请使用菜单栏或按 Ctrl+D 手动收藏!');
}
}
else if (window.sidebar) {
window.sidebar.addPanel(title, url, "");
}
else {
alert('对不起,由于您的浏览器功能限制,请使用菜单栏或按 Ctrl+D 手动收藏!');
}
}
Run code
Cut to clipboard
#,广西南宁市,2017-12-15,14:34:36, 用CSS让字体在一行内显示不换行
//创建信息窗口
var infoWindow1 = new BMap.InfoWindow("广西华都环境投资集团有限公司<p style='word-break:keep-all;white-space:nowrap;'>地址:南宁市青秀区东葛路118号南宁青秀万达广场东9栋2701室</p><p>电话:<?php echo $wen_tel;?></p>");
if($kw){
foreach($arr as $rk=>$rv){
$nrv[$rv['md5']]=$rv;
}
$arr=array_values($nrv);
}
Run code
Cut to clipboard
#,广西南宁市,2017-12-12,15:15:59, MYSQL对某个字段去重
SELECT *, COUNT(DISTINCT iswtf) FROM table GROUP BY iswtf
Run code
Cut to clipboard
#,广西南宁市,2017-12-12,15:19:23, mysql去除重复数据 group by order by 同时使用 mysql去重复查询 查询去除重复 MySQL去除查询结果重复值 mysql查询所有记录,并去掉重复的记录 mysql去重复 保留一条
$sql='SELECT *, COUNT(DISTINCT iswtf) FROM viiscc where tagss like \'%'.$kw.'%\' or sceneii like \'%'.$kw.'%\' GROUP BY iswtf order by tc '.$obrddd.', sc '.$obrddd.', id '.$obrddd.' limit '.$ps.','.$psize;
#723
#724
#725
#nav_top span:active{font-size:20px}#726
#727
用到百度地图。功能要求将一批标记点加入地图,点击其中任意一个点,地图弹出InfoWindow框,里面显示与此点相关的内容。
按照常规写了如下代码:
var node = function(){ name; lng; lat; }; addmarks = function(nodes){ var _nodes = nodes; var _markers = new Array(); for(var i=0;i<_nodes.length;i++){ var _marker = new BMap.Marker(new BMap.Point(_nodes[i].lng, _nodes[i].lat)); var _node = _nodes[i]; var _html = "节点名:"+_node.name; _marker.addEventListener("click", function(e){ this.openInfoWindow(new BMap.InfoWindow(_html)); }); _marker.addEventListener("mouseover", function(e){ this.setTitle("坐标@ "+_node.lng+","+_node.lat); }); _markers.push(_marker); } myClusterer = new BMapLib.MarkerClusterer(myMap, {markers:_markers}); myClusterer.setMaxZoom(17); //myClusterer.setStyles(myStyles); };上网查了一下,没有人给出具体解决,只是提出了javascript的闭包来解决。
于是采用闭包方式重新写了代码:
addmarks = function(nodes){ var _nodes = nodes; var _markers = new Array(); for(var i=0;i<_nodes.length;i++){ var _html = "节点名:"+_node.name; shop_markers.push(createMark(_nodes[i], _html)); } myClusterer = new BMapLib.MarkerClusterer(myMap, {markers:shop_markers}); myClusterer.setMaxZoom(17); //myClusterer.setStyles(myStyles); }; createMark = function(node, info_html){ var _marker = new BMap.Marker(new BMap.Point(node.lng, node.lat)); _marker.addEventListener("click", function(e){ this.openInfoWindow(new BMap.InfoWindow(info_html)); }); _marker.addEventListener("mouseover", function(e){ this.setTitle("位于: "+node.lng+","+node.lat); }); return _marker; };marker = g.marker(new BMap.Point(data.ProductList[i].LongPoint, data.ProductList[i].LatPoint), { shadow: true }); map.addOverlay(marker); //添加图标 var initPoint = new BMap.Point(data.ProductList[i].LongPoint, data.ProductList[i].LatPoint); var infoWindow = new BMap.InfoWindow(infoHtml); // 创建信息窗口对象 marker.addEventListener("click", function() { map.setCenter(this.getPosition()); this.openInfoWindow(infoWindow, initPoint);两行代码就搞定这个问题
_marker.provalue = _html; map.addOverlay(_marker ); _marker .addEventListener('click', function () { this.openInfoWindow(new BMap.InfoWindow(this.provalue)); });#728
宏越钢结构地图
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4"></script> <script type="text/javascript"> // 百度地图API功能 var map = new BMap.Map("map"); map.centerAndZoom(new BMap.Point(108.354387,22.79029),19); var marker1 = new BMap.Marker(new BMap.Point(108.354387,22.79029)); //创建标注 map.addOverlay(marker1); // 将标注添加到地图中 //创建信息窗口 var infoWindow1 = new BMap.InfoWindow("广西宏越钢结构工程有限公司<br>电话:0771-5387865<br>地址:广西南宁市青秀区柳沙路8号"); marker1.addEventListener("click", function(){this.openInfoWindow(infoWindow1);}); </script>点击收藏js按钮
function addFavorite() { var url = window.location; var title = document.title; var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("360se") > -1) { alert("由于360浏览器功能限制,请按 Ctrl+D 手动收藏!"); } else if (ua.indexOf("msie 8") > -1) { window.external.AddToFavoritesBar(url, title); //IE8 } else if (document.all) { try{ window.external.addFavorite(url, title); }catch(e){ alert('对不起,由于您的浏览器功能限制,请使用菜单栏或按 Ctrl+D 手动收藏!'); } } else if (window.sidebar) { window.sidebar.addPanel(title, url, ""); } else { alert('对不起,由于您的浏览器功能限制,请使用菜单栏或按 Ctrl+D 手动收藏!'); } }//创建信息窗口 var infoWindow1 = new BMap.InfoWindow("广西华都环境投资集团有限公司<p style='word-break:keep-all;white-space:nowrap;'>地址:南宁市青秀区东葛路118号南宁青秀万达广场东9栋2701室</p><p>电话:<?php echo $wen_tel;?></p>");一般的文字截断(适用于内联与块):
.text-overflow{ display:block; /*内联对象需加*/ width:31em; word-break:keep-all; /* 不换行 */ white-space:nowrap; /* 不换行 */ overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */ text-overflow:ellipsis; /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/ }对于表格,定义有点不一样:
table{ width:30em; table-layout:fixed; /* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */ } td{ width:100%; word-break:keep-all; /* 不换行 */ white-space:nowrap; /* 不换行 */ overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */ text-overflow:ellipsis; /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/ }注:这个只对单行的文字的效,如果你想把它用在多行上,也只有第一行有作用的。 这个写法只有IE会有“...”,其它的浏览器文本超出指定宽度时会隐藏。
#729
WXML
<!--index.wxml--> <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-dots="true" style="height:{{imgheightsheight}}px;"> <block wx:for="{{imgUrls}}"> <swiper-item> <image src="{{item}}" class="slide-image" width="100%" bindload="imageLoad" style="width:100%;height:{{imgheightsheight}}px;" /> </swiper-item> </block> </swiper>JS
Page({ data: { imgUrls: [ 'http://newtest.test2.resonance.net.cn/xcximg/01.jpg', 'http://newtest.test2.resonance.net.cn/xcximg/01.jpg', 'http://newtest.test2.resonance.net.cn/xcximg/01.jpg' ], indicatorDots: false, autoplay: false, interval: 5000, duration: 1000 }, changeIndicatorDots: function (e) { this.setData({ indicatorDots: !this.data.indicatorDots }) }, changeAutoplay: function (e) { this.setData({ autoplay: !this.data.autoplay }) }, intervalChange: function (e) { this.setData({ interval: e.detail.value }) }, durationChange: function (e) { this.setData({ duration: e.detail.value }) }, imageLoad: function (e) { //获取图片真实宽度 //var imgwidth = e.detail.width, //imgheight = e.detail.height, //宽高比 //ratio = imgwidth / imgheight; //console.log(imgwidth, imgheight) var imageSize = {}; var originalWidth = e.detail.width;//图片原始宽 var originalHeight = e.detail.height;//图片原始高 var originalScale = originalHeight / originalWidth;//图片高宽比 var that=this //获取屏幕宽高 wx.getSystemInfo({ success: function (res) { var windowWidth = res.windowWidth; var windowHeight = res.windowHeight; var windowscale = windowHeight / windowWidth;//屏幕高宽比 //console.log('windowWidth: ' + windowWidth) //console.log('windowHeight: ' + windowHeight) if (originalScale < windowscale) {//图片高宽比小于屏幕高宽比 //图片缩放后的宽为屏幕宽 imageSize.imageWidth = windowWidth; imageSize.imageHeight = (windowWidth * originalHeight) / originalWidth; } else {//图片高宽比大于屏幕高宽比 //图片缩放后的高为屏幕高 imageSize.imageHeight = windowHeight; imageSize.imageWidth = (windowHeight * originalWidth) / originalHeight; } that.setData({ imgheightsheight: windowHeight, }) } }) //console.log(imageSize); //计算的高度值 //var viewHeight = 750 / ratio; // var imgheight = viewHeight ///var imgheights = this.data.imgheights //把每一张图片的高度记录到数组里 /*imgheights.push(imgheight) this.setData({ imgheights: imgheights, })*/ }, })data: { //图片 hdimg: [], //是否采用衔接滑动 circular: true, //是否显示画板指示点 indicatorDots: false, //选中点的颜色 indicatorcolor: "#000", //是否竖直 vertical: false, //是否自动切换 autoplay: false, //滑动动画时长毫秒 duration: 100, //所有图片的高度 imgheights: [], //图片宽度 imgwidth: 750, //默认 current:0 },imageLoad: function (e) { //获取图片真实宽度 var imgwidth = e.detail.width, imgheight = e.detail.height, //宽高比 ratio = imgwidth / imgheight; console.log(imgwidth, imgheight) //计算的高度值 var viewHeight = 750 / ratio; var imgheight = viewHeight var imgheights = this.data.imgheights //把每一张图片的高度记录到数组里 imgheights.push(imgheight) this.setData({ imgheights: imgheights, }) }, bindchange: function (e) { console.log(e.detail.current) this.setData({ current: e.detail.current}) }<view> <swiper class="swiper" indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" autoplay="{{autoplay}}" duration="{{duration}}" bindchange="bindchange" circular="{{circular}}" style="height:{{imgheights[current]}}rpx;"> <block wx:for="{{hdimg}}" wx:key="{{index}}"> <swiper-item > <image src="{{item}}" mode="aspectFit" bindload="imageLoad" class=".itemimage" style="height:{{imgheights[current]}}rpx;width:{{imgwidth}}rpx;"/> </swiper-item> </block> </swiper> </view>.swiper { width: 100%; }修复版本高度100%bug上算法计算高度有问题
Page({ data: { imgUrls: [ 'http://newtest.test2.resonance.net.cn/xcximg/02.jpg?1', 'http://newtest.test2.resonance.net.cn/xcximg/03.jpg?1', 'http://newtest.test2.resonance.net.cn/xcximg/04.jpg?1' ], indicatorDots: false, autoplay: false, interval: 5000, duration: 1000 }, changeIndicatorDots: function (e) { this.setData({ indicatorDots: !this.data.indicatorDots }) }, changeAutoplay: function (e) { this.setData({ autoplay: !this.data.autoplay }) }, intervalChange: function (e) { this.setData({ interval: e.detail.value }) }, durationChange: function (e) { this.setData({ duration: e.detail.value }) }, imageLoad: function (e) { //获取图片真实宽度 //var imgwidth = e.detail.width, //imgheight = e.detail.height, //宽高比 //ratio = imgwidth / imgheight; //console.log(imgwidth, imgheight) var imageSize = {}; var originalWidth = e.detail.width;//图片原始宽 var originalHeight = e.detail.height;//图片原始高 var originalScale = originalHeight / originalWidth;//图片高宽比 var that=this //获取屏幕宽高 wx.getSystemInfo({ success: function (res) { var windowWidth = res.windowWidth; var windowHeight = res.windowHeight; //var windowscale = windowHeight / windowWidth;//屏幕高宽比 //console.log('windowWidth: ' + windowWidth) //console.log('windowHeight: ' + windowHeight) /*if (originalScale < windowscale) {//图片高宽比小于屏幕高宽比 //图片缩放后的宽为屏幕宽 imageSize.imageWidth = windowWidth; imageSize.imageHeight = (windowWidth * originalHeight) / originalWidth; } else {//图片高宽比大于屏幕高宽比 //图片缩放后的高为屏幕高 imageSize.imageHeight = windowHeight; imageSize.imageWidth = (windowHeight * originalWidth) / originalHeight; }*/ var imgheightsheight = originalScale * windowWidth;//(windowHeight * originalWidth) / windowWidth //console.log(imgheightsheight); that.setData({ imgheightsheight: imgheightsheight, }) } }) //console.log(imageSize); //计算的高度值 //var viewHeight = 750 / ratio; // var imgheight = viewHeight ///var imgheights = this.data.imgheights //把每一张图片的高度记录到数组里 /*imgheights.push(imgheight) this.setData({ imgheights: imgheights, })*/ }, })#730
老板:牛逼,那这辆车怎么前进?磁悬浮?
楼主:不是
老板:气垫?
楼主:不是
老板:吊索?
楼主:不是
老板:反重力?
楼主:都不是,就是一辆普通汽车,不装轮子
老板:xx,我有个超牛逼的想法,我们造的这辆车,不装轮子
员工:是么,那这辆车怎么前进?磁悬浮?
老板:不是
员工:气垫?
老板:不是
员工:吊索?
老板:不是
员工:反重力?
老板:都不是,就是一辆普通汽车,不装轮子
员工: 。。。。。。。。。。。。。
#731
#732
#733
<script> //自适应宽度列数 var nnw=document.body.clientWidth; var nums=parseInt(nnw/200);//图片宽度200 document.write('<style>.waterfall{-moz-column-count:'+nums+'; /* Firefox */-webkit-column-count:'+nums+'; /* Safari 和 Chrome */column-count:'+nums+';-moz-column-gap: 1em;-webkit-column-gap: 1em;column-gap: 1em;}</style>') </script><style> img{width:200px;border:10px solid #ddd;box-sizing: border-box;} </style> <div class="waterfall"> <img src="http://img.hb.aicdn.com/b31acc570c8da8e9436829c8e04fef81159eef7116081-zD1mO2_fw658"> <img src="http://img.hb.aicdn.com/5f359596645040f8609dafa9c073b464c81850251824eb-Hzd7kn_fw658"> <img src="http://img.hb.aicdn.com/59efd2ee6f50e54ee1c067e45dc53a43112003641f73a-MRomA8_fw658"> <img src="http://img.hb.aicdn.com/b31acc570c8da8e9436829c8e04fef81159eef7116081-zD1mO2_fw658"> <img src="http://img.hb.aicdn.com/5f359596645040f8609dafa9c073b464c81850251824eb-Hzd7kn_fw658"> <img src="http://img.hb.aicdn.com/59efd2ee6f50e54ee1c067e45dc53a43112003641f73a-MRomA8_fw658"><img src="http://img.hb.aicdn.com/6011915376ebbf461282fd3609e908fa4392f1c42200ec-8p9Wfy_fw658"> <img src="http://img.hb.aicdn.com/5f359596645040f8609dafa9c073b464c81850251824eb-Hzd7kn_fw658"> <img src="http://img.hb.aicdn.com/59efd2ee6f50e54ee1c067e45dc53a43112003641f73a-MRomA8_fw658"><img src="http://img.hb.aicdn.com/464018fc59c94a1bcab810565a1b0998edbd01031eb1c-WoTS41_fw658"> <img src="http://img.hb.aicdn.com/5f359596645040f8609dafa9c073b464c81850251824eb-Hzd7kn_fw658"> <img src="http://img.hb.aicdn.com/59efd2ee6f50e54ee1c067e45dc53a43112003641f73a-MRomA8_fw658"><img src="http://img.hb.aicdn.com/b31acc570c8da8e9436829c8e04fef81159eef7116081-zD1mO2_fw658"> <img src="http://img.hb.aicdn.com/5f359596645040f8609dafa9c073b464c81850251824eb-Hzd7kn_fw658"> <img src="http://img.hb.aicdn.com/59efd2ee6f50e54ee1c067e45dc53a43112003641f73a-MRomA8_fw658"><img src="http://img.hb.aicdn.com/b31acc570c8da8e9436829c8e04fef81159eef7116081-zD1mO2_fw658"> <img src="http://img.hb.aicdn.com/5f359596645040f8609dafa9c073b464c81850251824eb-Hzd7kn_fw658"> <img src="http://img.hb.aicdn.com/59efd2ee6f50e54ee1c067e45dc53a43112003641f73a-MRomA8_fw658"><img src="http://img.hb.aicdn.com/b31acc570c8da8e9436829c8e04fef81159eef7116081-zD1mO2_fw658"> <img src="http://img.hb.aicdn.com/5f359596645040f8609dafa9c073b464c81850251824eb-Hzd7kn_fw658"> <img src="http://img.hb.aicdn.com/59efd2ee6f50e54ee1c067e45dc53a43112003641f73a-MRomA8_fw658"><img src="http://img.hb.aicdn.com/b31acc570c8da8e9436829c8e04fef81159eef7116081-zD1mO2_fw658"> <img src="http://img.hb.aicdn.com/5f359596645040f8609dafa9c073b464c81850251824eb-Hzd7kn_fw658"> <img src="http://img.hb.aicdn.com/59efd2ee6f50e54ee1c067e45dc53a43112003641f73a-MRomA8_fw658"> </div> <script> //自适应宽度列数 var nnw=document.body.clientWidth; var nums=parseInt(nnw/200);//图片宽度200 document.write('<style>.waterfall{-moz-column-count:'+nums+'; /* Firefox */-webkit-column-count:'+nums+'; /* Safari 和 Chrome */column-count:'+nums+';-moz-column-gap: 1em;-webkit-column-gap: 1em;column-gap: 1em;}</style>') </script>#734
微信请在菜单中选择在浏览器中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>微信弹出遮罩</title> </head> <body> <style type="text/css"> *{margin:0; padding:0;} img{max-width: 100%; height: auto;} .test{height: 600px; max-width: 600px; font-size: 40px;} </style> <div class="test"> <a href="http://mp.weixin.qq.com/mp/redirect?url=http://mobile.xinlianwang.com/android/distributor/DistributorApp.apk#weixin.qq.com#wechat_redirect ">有效跳转</a> </div> <script type="text/javascript"> function is_weixin() { var ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") { return true; } else { return false; } } var isWeixin = is_weixin(); var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight; function loadHtml(){ var div = document.createElement('div'); div.id = 'weixin-tip'; div.innerHTML = '<p><img src="live_weixin.png" alt="微信打开"/></p>'; document.body.appendChild(div); } function loadStyleText(cssText) { var style = document.createElement('style'); style.rel = 'stylesheet'; style.type = 'text/css'; try { style.appendChild(document.createTextNode(cssText)); } catch (e) { style.styleSheet.cssText = cssText; //ie9以下 } var head=document.getElementsByTagName("head")[0]; //head标签之间加上style样式 head.appendChild(style); } var cssText = "#weixin-tip{position: fixed; left:0; top:0; background: rgba(0,0,0,0.8); filter:alpha(opacity=80); width: 100%; height:100%; z-index: 100;} #weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}"; if(isWeixin){ loadHtml(); loadStyleText(cssText); } </script> </body> </html>#735
#736
《「名探侦コナン」メインテーマ(ヴォーカルヴァージョン)》
#737
#738
<style> /*页面变灰*/ html, img, div, li, ul, span, em, a, i{ -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); filter:gray; /*ie9- */ } </style>#739
下联:拍大腿后悔 拍屁股走人
横批:一地鸡毛
#740
吴永宁坠亡前影像曝光
生前曾挣扎
吴咏宁 攀爬大楼 镜头 直播 高空 恐高
#741
<?php //定义数组 $arr=array( "name"=>"zhidao", "age"=>"10" ); $result = array_values($arr); var_dump($result); /*array(2) { [0]=> string(6) "zhidao" [1]=> string(2) "10" }*/if($kw){ foreach($arr as $rk=>$rv){ $nrv[$rv['md5']]=$rv; } $arr=array_values($nrv); }SELECT *, COUNT(DISTINCT iswtf) FROM table GROUP BY iswtf$sql='SELECT *, COUNT(DISTINCT iswtf) FROM viiscc where tagss like \'%'.$kw.'%\' or sceneii like \'%'.$kw.'%\' GROUP BY iswtf order by tc '.$obrddd.', sc '.$obrddd.', id '.$obrddd.' limit '.$ps.','.$psize;