javascript

better css for the drupal hovertip module

don't get me wrong, i'm a happy customer of the drupal hovertip module. everything worked out of the box, and i've enjoyed using it to cram even more pictures into my website. however, the included default css leaves a little to be desired for the following reasons :

  1. it's too specific. it assigns a very particular look and feel to your tooltips, complete with background colors, fixed widths and font sizes. sure, in theory, you can override all that in your theme css. but if css specificity is not your thing, you're going to be tearing your hair out trying to figure how to do it.
  2. the ui element chosen to indicate "hover here" is non-standard. the "hover here" directive is admittedly fairly new, but the emerging standard seems to be the dashed-underline (certainly not the italic font used in the drupal hovertip module).
  3. the clicktip css does not work on ie6. the link to close the clicktip has mysteriously gone missing.

you can download a more generic, flexible version of the necessary hovertip module css that solves all these issues here. here are some examples of how to use it.

adding a javascript counter to your drupal forms

if you want to add a javascript counter (n characters remaining) to your drupal forms, you can do the following (jquery code based very heavily on the jquery tricks on reindel.com)

adding external javascript content to your drupal nodes or views

sometimes you want to include jquery / javascript code in content areas in your nodes, views etc. it's arguable that this code is better in managed in the filesystem (under source code control) than in your database-stored-node. here's how you might do it using a php include.

using jquery for in-place prompt text in your exposed drupal filters

when using exposed filters in drupal, it's sometimes nice to place the prompt text for a form field inside the form field itself e.g. for a very compact form. here's a way to do this using jquery.
syndicate content