Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [jQuery] Wyświetlanie tooltipów dla treści generowanej dynamicznie
Entaro
post
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 23.07.2009

Ostrzeżenie: (0%)
-----


Witam mam problem z pluginem do wyświetlania tooltipow. Mianowicie generuje sobie dynamicznie treść, która wygląda tak:
  1. <div class="issue_list">
  2. <div class="note_edit"><span class="dane"><a
  3. href="/note/edit/id/26"><img title="Edit note"
  4. src="/skins/test/images/icons/note_edit.png" alt="" /></a></span></div>
  5. <div class="note_remove"><span class="dane"><a
  6. href="/note/remove/id/26"><img title="Remove note"
  7. src="/skins/test/images/icons/note_remove.png" alt="" /></a></span></div>
  8. <div class="note_note_text"><span class="dane">fgsfsdf</span></div>
  9. <div class="note_problem_title"><span class="dane"><a
  10. href="/problem/view/id/47" " class="problem_link">Approval test</a></span></div>
  11. <div class="note_create_date"><span class="dane">18.05</span></div>
  12. </div>
  13. <div class="issue_list">
  14. <div class="note_edit"><span class="dane"><a
  15. href="/note/edit/id/25"><img title="Edit note"
  16. src="/skins/test/images/icons/note_edit.png" alt="" /></a></span></div>
  17. <div class="note_remove"><span class="dane"><a
  18. href="/note/remove/id/25"><img title="Remove note"
  19. src="/skins/test/images/icons/note_remove.png" alt="" /></a></span></div>
  20. <div class="note_note_text"><span class="dane">fddfgds</span></div>
  21. <div class="note_problem_title"><span class="dane"><a
  22. href="/problem/view/id/48" " class="problem_link">Kaczynski burial
  23. plan causes split</a></span></div>
  24. <div class="note_create_date_p"><span class="dane">18.05</span></div>
  25. </div>


Chciałbym aby po najechaniu myszką na <div class="note_note_text_p"> w tooltipe pojawił się tekst zawarty w tym właśnie divie. Skrypt do zrobienia tego wygląda następująco:
  1. <script type="text/javascript">
  2. $(document).ready(function()
  3. {
  4. $('div.note_note_text').qtip({
  5. content: {
  6. text: $('span.dane', this).text()
  7. },
  8. style: {
  9. name: 'light'
  10. },
  11. position: {
  12. corner: {
  13. target: 'topRight',
  14. tooltip: 'topLeft'
  15. },
  16. target: 'mouse'
  17. }
  18.  
  19. });
  20.  
  21. });
  22.  
  23. </script>

Mój problem polega na tym, że zamiast wyświetlać tekst zawarty w divie na, który akurat najechaliśmy myszką, wyświetla wszystkie teksty zawarte w div o klasie 'note_note_text'. Problem leży w tym fragmencie kodu tylko nie wiem jak go rozwiązać.
  1. content: {
  2. text: $('span.dane', this).text()
  3. },
Go to the top of the page
+Quote Post
erix
post
Post #2





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Hmm:
  1. jaka to wtyczka do tooltipów? (domyślam się, ale lepiej żebyś uściślił)
  2. daj gdzieś DZIAŁAJĄCY kod


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
misiek08
post
Post #3





Grupa: Zarejestrowani
Postów: 91
Pomógł: 6
Dołączył: 2.02.2008

Ostrzeżenie: (10%)
X----


Może:
  1. text: this.find('span.dane').text()


Ten post edytował misiek08 19.06.2010, 15:06:55
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 01:02