Witam mam problem z pluginem do wyświetlania tooltipow. Mianowicie generuje sobie dynamicznie treść, która wygląda tak:
<div class="note_edit"><span class="dane"><a href="/note/edit/id/26"><img title="Edit note" src="/skins/test/images/icons/note_edit.png" alt="" /></a></span></div> <div class="note_remove"><span class="dane"><a href="/note/remove/id/26"><img title="Remove note" src="/skins/test/images/icons/note_remove.png" alt="" /></a></span></div> <div class="note_problem_title"><span class="dane"><a href="/problem/view/id/47" " class="problem_link">Approval test
</a></span></div> <div class="note_edit"><span class="dane"><a href="/note/edit/id/25"><img title="Edit note" src="/skins/test/images/icons/note_edit.png" alt="" /></a></span></div> <div class="note_remove"><span class="dane"><a href="/note/remove/id/25"><img title="Remove note" src="/skins/test/images/icons/note_remove.png" alt="" /></a></span></div> <div class="note_problem_title"><span class="dane"><a href="/problem/view/id/48" " class="problem_link">Kaczynski burial
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:
<script type="text/javascript"> $(document).ready(function()
{
$('div.note_note_text').qtip({
content: {
text: $('span.dane', this).text()
},
style: {
name: 'light'
},
position: {
corner: {
target: 'topRight',
tooltip: 'topLeft'
},
target: 'mouse'
}
});
});
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ć.
content: {
text: $('span.dane', this).text()
},