parent
9c214ef57b
commit
2856cd06d5
@ -0,0 +1,22 @@
|
|||||||
|
/**
|
||||||
|
* Created by ttang on 2016/9/20.
|
||||||
|
*/
|
||||||
|
app.directive('imgPreview',["$timeout",'wx',function(timer,wx){
|
||||||
|
return{
|
||||||
|
restrict: 'A',
|
||||||
|
scope: {},
|
||||||
|
link: function(scope, element){
|
||||||
|
timer(function(){
|
||||||
|
var srcList = [];
|
||||||
|
$.each($(".post-all-content img"),function(i,item){
|
||||||
|
if(item.src){
|
||||||
|
srcList.push(item.src);
|
||||||
|
$(item).click(function(e){
|
||||||
|
wx.previewImage(this.src,srcList);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]);
|
Loading…
Reference in new issue