mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Fix stretching of image on mobile
This commit is contained in:
parent
653ca4f697
commit
32c9c91b82
1 changed files with 16 additions and 10 deletions
|
|
@ -232,6 +232,7 @@ var initPhotoSwipeFromDOM = function(gallerySelector) {
|
||||||
var regx_skip = /(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i;
|
var regx_skip = /(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i;
|
||||||
var regx_allow_i6pngfix = /(?:common\/tpl\/images\/blank\.gif$)/i;
|
var regx_allow_i6pngfix = /(?:common\/tpl\/images\/blank\.gif$)/i;
|
||||||
|
|
||||||
|
var isMobile = String(navigator.userAgent).match(/mobile/i);
|
||||||
var galleryImgEls = $(galleryElements[i]).find(ps_find_selector);
|
var galleryImgEls = $(galleryElements[i]).find(ps_find_selector);
|
||||||
for(var j = 0, jl = galleryImgEls.length; j < jl; j++) {
|
for(var j = 0, jl = galleryImgEls.length; j < jl; j++) {
|
||||||
// skip components
|
// skip components
|
||||||
|
|
@ -240,6 +241,11 @@ var initPhotoSwipeFromDOM = function(gallerySelector) {
|
||||||
//$(galleryImgEls[j]).attr('data-pswp-uid', i+1);
|
//$(galleryImgEls[j]).attr('data-pswp-uid', i+1);
|
||||||
$(galleryImgEls[j]).attr('data-pswp-pid', j+1);
|
$(galleryImgEls[j]).attr('data-pswp-pid', j+1);
|
||||||
|
|
||||||
|
// Fix stretching of image on mobile
|
||||||
|
if (isMobile) {
|
||||||
|
galleryImgEls[j].style.height = 'auto';
|
||||||
|
galleryImgEls[j].height = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue