|
|
@@ -68,19 +68,23 @@
|
|
|
scope.imgWidth = 715;
|
|
|
scope.imgHeight = 395;
|
|
|
var html = '<a class="thumbnail"' + '>' +
|
|
|
- '<img onclick="javascript:window.open(this.src,\'\',\'height=' + scope.imgHeight + ',width=' + scope.imgWidth + ',top=200,left=200,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no\')" style="max-width:270px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.png' + '" onError= "this.src = \'../img/loading.gif\'" alt="截图缩略图" >' +
|
|
|
+ '<img onclick="javascript:window.open(this.src,\'\',\'height=' + scope.imgHeight + ',width=' + scope.imgWidth + ',top=200,left=200,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no\')" style="max-width:270px;max-height:250px;" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" onError= "this.src = \'../img/loading.gif\'" alt="截图缩略图" >' +
|
|
|
'</a>';
|
|
|
// '<div class="bigImg">' +
|
|
|
// '<img ng-click="hover = false" ng-show="hover" src="local://' + scope.appContent.directory.received + g[1] + '.JPG' + '" alt="" >' +
|
|
|
// '</div>';
|
|
|
|
|
|
- loadImg("local://" + scope.appContent.directory.received + g[1] + ".png", addImg, error);
|
|
|
+ var imgSize = loadImg("local://" + scope.appContent.directory.received + g[1] + ".JPG", addImg, errorImg);
|
|
|
+ console.log(imgSize);
|
|
|
|
|
|
- function loadImg(url, callback) {
|
|
|
+ function loadImg(url, callback, error) {
|
|
|
var img = new Image();
|
|
|
img.onload = function() {
|
|
|
img.onload = null;
|
|
|
callback(img);
|
|
|
+ var imgSize = { height: img.height, width: img.width };
|
|
|
+ console.log(imgSize);
|
|
|
+ return imgSize;
|
|
|
}
|
|
|
img.onerror = function() {
|
|
|
//alert("error!");
|
|
|
@@ -91,16 +95,12 @@
|
|
|
angular.element("img").attr("defaulturl", "../img/loading.jpg");
|
|
|
}
|
|
|
|
|
|
- function error(img) {
|
|
|
+ function errorImg(img) {
|
|
|
gotoBottom();
|
|
|
}
|
|
|
|
|
|
function addImg(img) {
|
|
|
//$(img).appendTo($(".image"));
|
|
|
- scope.imgWidth = img.width;
|
|
|
- scope.imgHeight = img.height;
|
|
|
- console.log(scope.imgHeight);
|
|
|
- console.log(scope.imgWidth);
|
|
|
gotoBottom();
|
|
|
}
|
|
|
return html;
|