내 프로젝트 페이지에서 장소에 대한 갤러리가 있고 제목에 현재 위치에 대한 설명이있는 위키 사이트에 대한 URL이 있습니다. 링크 페이지를 클릭하면 같은 창에서 열립니다. 불을 지르고 모든 것이 잘 보이는
은 내가 실행 URL을
// Enable anchor clicks in the injected caption html.
// Thanks Nate Wright for the fix. @https://github.com/NateWr
if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") {
this.$lightbox.find('.lb-caption')
.html(this.album[this.currentImageIndex].title)
.fadeIn('fast')
.find('a').on('click', function(event){
location.href = $(this).attr('href');
});
}
에 대한 책임을 생각 라이트 라이브러리에서 무언가를 발견 (속성 등 대상)하지만 난 그 100 % 확실하지 않다 이 사람이 내가 할 수있는 곳을 보여줄 수 있을까? 날짜 코드와 depened 여는 링크는 "대상"속성에 의해?
편집
:
확인이 발견 솔루션이 위에서 코드를 교체해야하고 나를 위해 작동, github에 https://github.com/lokesh/lightbox2/pull/299/files
if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") {
this.$lightbox.find('.lb-caption')
.html(this.album[this.currentImageIndex].title)
.fadeIn('fast')
.find('a').on('click', function (event) {
if ($(this).attr('target') !== undefined) {
window.open($(this).attr('href'), $(this).attr('target'));
} else {
location.href = $(this).attr('href');
}
});
}
아악, 내 덕분에 그것을 발견! – Ariane
문제는 남아 있습니다 :'window.open()'으로 새 탭을 열면 브라우저에 의해 팝업으로 차단됩니다. 나는 그것을 할 대체 방법이 있는지 궁금해. – Ariane
나를 위해 일했습니다! 정말 고마워! – Ecliptica