게시판 리스트에서 내용 레이어 미리보기 때문에 질문 드립니다.

게시판 리스트에서 내용 레이어 미리보기 때문에 질문 드립니다.

QA

게시판 리스트에서 내용 레이어 미리보기 때문에 질문 드립니다.

본문

리스트에서 제목에 마우스 오버하면 내용이 레이어로 나오는 건데 오류가 있어서 질문 드립니다.

잘 나오다가 갑자기 내용이 안나오고 undefined 라고 나옵니다.

새로고침하면 또 다시 잘나오다가 마우스로 제목에 여러번 왔다갔다하면 또 안나옵니다 ㅠ

이 오류 해결할수 있는 방법 없을까요?

 


<script type="text/javascript">
$(document).ready(function() {
 //Select all anchor tag with rel set to tooltip
 $('a[rel=tooltip]').mouseover(function() {
  
  //Grab the title attribute's value and assign it to a variable
  var tip = $(this).attr('title_tip'); 
  
  //Remove the title_tip attribute's to avoid the native tooltip from the browser
  //$(this).attr('title_tip');
  
  //Append the tooltip template and its value
  $(this).append('<div id="tooltip">' + tip + '</div>');  
    
  //Show the tooltip with faceIn effect
  $('#tooltip').fadeIn('500');
  $('#tooltip').fadeTo('10',0.9);
  
 }).mousemove(function() {
 
  //Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse
   //$('#tooltip').css('top', e.pageY - 220 );
  //$('#tooltip').css('left', e.pageX -220 );
  
 }).mouseout(function() {
 
  //Put back the title_tip attribute's value
  $(this).attr('title_tip',$('#tooltip').html());
 
  //Remove the appended tooltip template
  $(this).children('div#tooltip').remove();
 });
});
</script>

<?php
$text_content = cut_str(strip_tags($list[$i][wr_content]),200," . . .");
echo "<a href='{$list[$i][href]}'rel='tooltip' title_tip='{$text_content}'><span>{$list[$i][subject]}</span></a>";
?>
 

이 질문에 댓글 쓰기 :

답변 1

아래의 링크를 참고하세요.

https://sir.kr/g5_skin/10534 

답변을 작성하시기 전에 로그인 해주세요.
전체 125,873 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT