0

からのテキストの表示に問題があります。

.click 関数を使用して p タグを表示するまで p タグを参照できます。クリック関数の後に表示された p タグを取得し、それをここにホバーポップアップ機能が私のコードです。

    $('.Article h1 a').click(function(event) {
    event.preventDefault();
    $(this.parentNode).next('p').fadeToggle(1000);
     $(this.parentNode).next('p').hover(function() { 
                         var paragraph  = $(this).next('p').text();
            $('#pop-up').find('h3').append(paragraph);
            $('#pop-up').show();
                }, function() {
        $('#pop-up').hide();
     });
  });

HTMLコードは次のとおりです。

    <div id="content">
    <div class="column">
    <div class="Article">
    <img src="images/SteveJobs.png" alt="Steve Jobs" Title="SteveJobs" />
    <h1><a href="#"> Computers changed Forever</a></h1>
    <p> The Brilliant Mind of Steve Jobs. </p>
     <a href="#" id="trigger">this link</a>

                <!-- HIDDEN / POP-UP DIV -->
                 <div id="pop-up">
                  <h3>Pop-up div Successfully Displayed</h3>

                 </div>
    </div>
4

2 に答える 2