게시판 lightbox 사용중인데요 채택완료
게시판 lightbox 사용중입니다.
list에서 이미지를 누르면 팝업이 뜹니다.
이 팝업부분에 글쓰기시 등록한 링크주소가 나타나게하고싶습니다. (물론 링크까지 되도록이요!)
view.skin.php에서는 링크주소가 나오는데..
팝업창에는 이미지만 출력이 됩니다.
php에서 링크를 출력해줄땐 아래 소스로 출력하고..
// 링크 ?> for ($i=1; $i<=$g4[link_count]; $i++) { if ($view[link][$i]) { $cnt++; $link = cut_str($view[link][$i], 70);
echo "
echo "
소스뒤져보니 js파일에서 팝업부분을 그려주는것같은데...
js에서 위 소스를 어떻게 적용시켜야될까요..?ㅠㅠ
http://duddmszzang.cafe24.com/lightbox.js">http://duddmszzang.cafe24.com/lightbox.js
위 주소가 js파일이예요. 다운받으실수있습니다..도와주세요 고수님들..ㅠㅠ
그려주는 부분은 찾기누르시고 _set_interface() 검색하시면 그부분인듯합니다.
제발 도와주세요ㅠㅠ
답변 1개
그많은 널리고 널린 라이트박스중에서 하필 링크기능 없는걸 고르셨나요...
예제 샘플도 있을건데 샘플 확인해보면서 a 링크 구성을 똑같이 해주셔야 합니다
title=""이 제목등 정보를 표시해주는 곳입니다
암튼 라이트박스내의 제목클릭하면 게시판으로 이동할수 잇게 수정해 보자면...해당줄을 교체 하고 새로이 link-data추가
----76줄---
if ( jQueryMatchedObj.length == 1 ) {
settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'),objClicked.getAttribute('link-data')));
} else {
// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title'),jQueryMatchedObj[i].getAttribute('link-data')));
}
}
----------------------
-------------246줄---
$('#lightbox-image-details-caption').html(''+settings.imageArray[settings.activeImage][1]+'').show();
-------------------------
그리고 html 부분 에다가 링크정보 가져갈 부분 새로이추가
link-data=""
ex) " title="" link-data="" rel~어쩌고~ >라이트박스 섬네일
js만 정보를 주셔서 html부분은 대충 위처럼 되어 있을거라 추정
-------------------
js만 올려놓으셔서 테스트는 못해봤음.....
==================================================
ps) 다시보니 목록이 아니라 본문에서 클릭시 첨부 링크를 라이트박스내에 보여주고 싶다군요...
그럼 다시 이렇게..
----76줄---
var cc=$('.board_view_wrd').html();
if ( jQueryMatchedObj.length == 1 ) {
settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title'),cc));
} else {
// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title'),cc));
}
}
----------------------
----------------------
" title="" 타이틀에 내용이 있어야 라이트박스내에 링크와 글이 라트박스 하단에 나오는 조건입니다
-------------246줄---
$('#lightbox-image-details-caption').html((settings.imageArray[settings.activeImage][2]?'
--------------
link-data추가는 필요없겟습니다.
물론 _set_interface() 이부분도 고칠필요없습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인