Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Fake inlineroll styling

1479458601

Edited 1479475239
Jakob
Sheet Author
API Scripter
I'm using the sendChat callback to send a bunch of rolls to chat, and output them later in a nice-looking way. I'm trying to recreate (to some reasonable extent) the tooltips you get for real inline rolls. The tooltips don't turn out quite right in the following way: when the rolls are close to the right border of the chat, if you mouse over, the tooltip gets jittery and flickers around when you move the mouse over the roll, instead of being displayed constantly like a real inline roll. To make things even more confusing, this behaviour seems to vanish when they are pushed up further in chat. Here's my code for displaying the roll: `<span class="showtip tipsy-n" title="Rolling ${expression}"` + `style="min-width:1em;display:inline-block;border:2px solid;background-color:#FEF68E;color:#404040;` + `font-weight:bold;padding:0px 3px;cursor:help">${result}</span>` I don't know if it makes a difference, and I have tried several ways of displaying it (table cell, right-floating div...). The one constant is that the roll is always in a big div: '<div style="border:1px solid #888;background-color:#FFFFFF;border-radius:5px;padding:1px 3px">' + content + '</div> I've noticed that roll20 replaces the inlinerollresult, showtip and tipsy-n classes by userscript-inlinerollresult, userscript-showtip and userscript-tipsy-n. Maybe there's some connection to this? I hope some css wizard can help me here, because I have no idea what I'm doing.
1479475000
Jakob
Sheet Author
API Scripter
Okay, update, I kind of have an idea of what the problem is: whenever the tooltip box has to appear "above the cursor", it has this strange flickering behaviour. When it appears below the cursor, it does not. (Which explains why the problem goes away once the roll has wandered up in the chat history. And for some reasons, for my fake inline rolls, it appears above when the roll is on the right hand side of the chat window, something which does not happen for real inline rolls.