§
Posted: 05-09-2015

help please

hello all, help me please for a script. so i have this table http://jsfiddle.net/gsc1759d/ , in that table is a column with number of comments, i want when i hover over number to show me a tooltip with those messages, page with comments is looking like this http://jsfiddle.net/8vc0nhko/ , i want a tooltip with number of user, name and comment, i have tried but i fail, it's showing only first comment
 
i want it more simple, something like
#1 user - Comment
------------------
#2 user - Comment
------------------
etc

thank you!

woxxomMod
§
Posted: 06-09-2015
Edited: 06-09-2015

Post the code you have now to jsfiddle.

§
Posted: 06-09-2015

i'm using the qtip plugin, maybe is there a better way?

$('a[href*="startcomments"]').each(function() { var el = $(this); $.get(this, function(data) { var subject = $(data).find('td.embedded, td.text').text().split("#")[1]; el.qtip({ style: { classes: 'ui-tooltip-shadow ui-tooltip-light ui-tooltip-rounded', width: 400, border: { width: 1, radius: 4, color: '#707070' }, 'font-size': '10pt', 'line-height': '120%', color: 'black', background: '#ebebeb' }, content: subject, show: 'mouseover', hide: 'mouseout', }); }); }); if i don't use .split("#")[1]then i get all text

woxxomMod
§
Posted: 06-09-2015
var icons = document.querySelectorAll('td.embedded .userIcons');
var texts = document.querySelectorAll('td.text');
var subject = [].map.call(icons, function(info, i) {
    return (info.parentNode.textContent + " - " + texts[i].textContent).replace(/[\r\n]+/g, " ");
}).join("\n");
§
Posted: 06-09-2015

i'm getting a blank tooltip :(

woxxomMod
§
Posted: 06-09-2015
Edited: 06-09-2015

Add debugger; to the code and debug it. Or use console in devtools.

Ehm, actually, in this case the reason is simple, my example uses document, just replace it with data or $(data)[0] or whatever.

Post reply

Sign in to post a reply.