Sunday, November 20, 2011

more popout notes for iBooks with Javascript

The previous post showed how to expose a concealed note as white on gray. Here's a related technique to show the note as black on white.

<p onclick="popoutblack(this)"><span class="inlinenote" style="color: transparent;">some text for the note</span>some text for the paragraph</p>

span.inlinenote {
display: block;
height: 0; /* default overflow is "visible", but 'invisible' since transparent */

function popoutblack(obj) { //switch transparencies
  switch ( {
case "": { //case no inline style defined for <p> = "transparent"; = "black"; // otherwise color (now transparent) is inherited
default: { // restore to original conditions = ""; ="transparent";

No comments:

Post a Comment