Authored by whb

视频高宽

... ... @@ -211,7 +211,7 @@ define('mobile', function(require, exports) {
function() {
$("video").each(function() { //设置视频高度
if($(this)[0].videoHeight > 0) {
$(this).css({"height": $(this)[0].videoHeight});
$(this).css({"height": Math.floor($(this)[0].videoHeight * (300 / $(this)[0].videoWidth)) });
videoPos++;
}
});
... ...
... ... @@ -605,6 +605,23 @@ define('yohood', function(require, exports) {
if ($(".lazy").size() == 1) {
$(".detail-slide-ctrl").remove();
}
//设置h5视频高度
var videoSize = $("video").size();
var videoPos = 0;
if(videoSize > 0) {
var videoInterval = setInterval(
function() {
$("video").each(function() { //设置视频高度
if($(this)[0].videoHeight > 0) {
$(this).css({"height": Math.floor($(this)[0].videoHeight * (640 / $(this)[0].videoWidth)) });
videoPos++;
}
});
if(videoPos >= videoSize) clearInterval(videoInterval);
}, 20);
}
}
//详情页资讯
... ...