ajout de imgs fullspread bleed
This commit is contained in:
@@ -161,21 +161,27 @@
|
||||
}
|
||||
}
|
||||
// images fullspread
|
||||
let fullspreadEl = document.querySelectorAll('.imgfullspreadleft, .imgfullspreadright');
|
||||
let fullspreadEl = document.querySelectorAll('.imgfullspreadleft, .imgfullspreadright, .imgfullspreadright_bleedtop, .imgfullspreadright_bleed');
|
||||
for (let i = 0; i < fullspreadEl.length; i++) {
|
||||
let imgSrc = fullspreadEl[i].firstElementChild.getAttribute('src');
|
||||
let nextPage = fullspreadEl[i].closest('.pagedjs_page').nextElementSibling.querySelectorAll('.pagedjs_page_content');
|
||||
let imgOverflowEl = document.createElement('div');
|
||||
if (fullspreadEl[i].classList.contains('imgfullspreadleft')) {
|
||||
imgOverflowEl.setAttribute('class', 'imgfullspreadleft-right');
|
||||
} else {
|
||||
} else if (fullspreadEl[i].classList.contains('imgfullspreadright')) {
|
||||
imgOverflowEl.setAttribute('class', 'imgfullspreadright-right');
|
||||
} else if (fullspreadEl[i].classList.contains('imgfullspreadright_bleedtop')) {
|
||||
imgOverflowEl.setAttribute('class', 'imgfullspreadright_bleedtop-right');
|
||||
} else if (fullspreadEl[i].classList.contains('imgfullspreadright_bleed')) {
|
||||
imgOverflowEl.setAttribute('class', 'imgfullspreadright_bleed-right');
|
||||
}
|
||||
let imgOverflow = document.createElement('img');
|
||||
imgOverflow.src = imgSrc;
|
||||
imgOverflowEl.append(imgOverflow);
|
||||
nextPage[0].append(imgOverflowEl);
|
||||
if (fullspreadEl[i].classList.contains('imgfullspreadright')) {
|
||||
if (fullspreadEl[i].classList.contains('imgfullspreadright')
|
||||
|| fullspreadEl[i].classList.contains('imgfullspreadright_bleedtop')
|
||||
|| fullspreadEl[i].classList.contains('imgfullspreadright_bleed')) {
|
||||
let imgMargin = imgOverflowEl.getBoundingClientRect().right - fullspreadEl[i].firstElementChild.getBoundingClientRect().right;
|
||||
fullspreadEl[i].firstElementChild.style.marginLeft = imgMargin + 'px';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user