stmatth
Karma: 1
|
Tooltip with nice formatting and markup - 2011/09/04 15:29
Hi again,
I had a look at the code for the tooltip and modified it so that the tooltips again come up as nice html, with the markup, and the possibility to include pictures, but without Javascript, i.e. purely css based.
I had to do some minor changes in glossary_plugin_content.php (only lines 175 and 199), and the style definitions (size of popup, colours etc.) are in puretip.css. It seems that Martin already had done some work on this, as the puretips.css already contained the basic idea.
Some notes:
- Basic idea is to have a span element in the link which is only displayed in the "hover" state. I modified it a bit more to have two span elements, one showing the term as a header, and the other the definition; together they look like a window with a darker title bar. This is in line 199
- There was some code that stripped out the html from the definition. That was necessary when it went into the title of the a tag, but for my popups I removed it. This is line 175
- With markup enabled, a big problem are p tags, which mess things up completely. So I added something to strip out the p tags from the glossary definition, also in line 175 (the markup produces a p at the beginning/end, and these are not necessary
I haven't done a lot of testing on this, but it seems to work so far, so I thought I share it, hoping it helps you with the development.
File Attachment:File name: puretip.cssFile size:1198 bytes Post edited by: stmatth, at: 2011/09/04 15:30
Post edited by: stmatth, at: 2011/09/04 15:32
Post edited by: stmatth, at: 2011/09/04 15:33
Stephan Matthiesen - Science-Texts: editorial team for scientific texts |