HAHAHAHAHAHHAAHHAHAHAHAHHAHAHAHAHAH
已经过了三年了,希望你已经解决了这个问题。
我刚刚研究出一个解决方案:
$('#gallery-1').on('click', 'a', function(event) {
let index = $(this).closest('.gallery-item').index('#gallery-1 .gallery-item');
setTimeout(()=>{
let galleryLightbox = $(`#elementor-lightbox-slideshow-${$(this).data('elementor-lightbox-slideshow')}`);
let swiper_target = galleryLightbox.find('.swiper');
if(swiper_target.length) {
let swiperInstance = swiper_target.data('swiper');
swiperInstance.loopDestroy();
swiperInstance.params.loop = false;
swiperInstance.update();
swiperInstance.slideTo(index, 0)
}
}, 500);
});
通过监听弹出图片,并使用 JS 动态修改 Swiper,请将 #gallery-1 替换为你的 Gallery ID。
Очень долго искал решение этой проблемы.
Для того чтобы переориентировать ось Y. Необходимо в extent
изменить точку отсчёта высоты, и сделать её отрицательной.
Далее в addCoordinateTransforms
нужно описать преобразование координаты по Y на отрицательную(минус на минус дают плюс)
В итоге мы получим смещение нулевой координаты в левый-верхний угол.
Вырезка ключевых элементов кода:
import { Projection, addCoordinateTransforms } from 'ol/proj'
import ImageLayer from 'ol/layer/Image'
import Static from 'ol/source/ImageStatic'
...
const extent = [0, -img.height, img.width, 0]
const projection = new Projection({
units: 'pixels',
extent: extent,
worldExtent: extent
})
addCoordinateTransforms(
projection,
projection,
function (coordinate) {
return coordinate
},
function (coordinate) {
return [coordinate[0], -coordinate[1]]
})
const targetImageLayer = new ImageLayer({
source: new Static({
attributions: '© TODO',
url: imageUrl,
projection: projection,
imageExtent: extent
})
})
...
UPD. Openlayers v.8.2.0
Вот написал regex
\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) # IP-адрес
:(?!0+)(?!6553[6-9])(?!655[4-9]\d)(?!65[6-9]\d\d)(?!6[6-9]\d\d\d)(?![7-9]\d\d\d\d)(\d{1,5}) # Порт
\b
确保assets/css/main.scss文件的开头包含YAML前置元数据:
请保留下面两条白线,这个是转化处理的识别前提!
---
---
@import "style";
@import "course-document";
这些空的YAML前置元数据行是必要的,它们告诉Jekyll处理这个文件。
如果进行了这些修改后问题仍然存在,请运行bundle exec jekyll build --trace并查看详细的错误输出,这可能会提供更多关于问题原因的信息。