Plugin Update: hoverfade-1.0.2

September 13, 2010

I recently updated my hoverFade jQuery plugin after using the plugin in a couple of projects and work and needing extra functionality. I’ve been waiting for the jQuery plugin site to come back up again (which it now has) after being locked down following major spam attacks. I also wanted to wait until I had chance to put some proper examples together following comments in the original plugin release post (which can be seen here).

Examples

Ok, so I finally had time to put an example page together. I’ll try and get some additional ones up soon, and keep it updated inline with the plugin…

Download

Usage

The plugin is designed to be used with navigation menus, where each menu item is made from an anchor element within a list-item element. You can apply the effect to different collections of elements by supplying new trigger and faderTemplate options (see the Configurable Options section below).

  1. First you should set up standard CSS hover states from the elements you want to add the effect to. This should be done using a class name on the container of the fading elements. This is so that basic CSS hovers are still used if JS is disabled on the client.
  2. Add selectors that show the same background image as the CSS hovers using a different class name. This different class name will be applied to the container and the CSS class name will be removed.
  3. Link to the plugin file from (ideally) the bottom of the page, after linking first to jQuery
  4. Call the plugin method on the same element that the CSS class was added to. if you use the default class names used by the plugin, and call the plugin on a standard list of links the plugin should just work.

There are 9 user-configurable options that can be set, which are listed in the next section

Configurable Options

The latest version of hoverFade has the following configuration options:

  • newClass: the new class to add, defaults to “hover-anims”
  • classToRemove: the existing class to remove, defaults to “hover-css”
  • onClass: class name to add to show a link as on, defaults to “on”
  • trigger: the target element that will trigger the animation, defaults to “a”
  • faderTemplate: the element to be used to show the animation, defaults to “<span />”
  • animSpeed NEW!: the speed of the animation, defaults to “normal”
  • exclude NEW!: a jQuery selector that should not have an animation state added to it, deaults to “”
  • ignoreSiblings NEW!: a jQuery selector that should not be animated, defaults to “”
  • retainHoverOn NEW!: a class name for elements that should not fade out on mouseleave, defaults to “”

Notes

The exclude is very similar to the on option except that the element with the on class name will have the animated state on show permanently, while any elements exluded from the animations with exclude will not have the animated state shown ever.

The ignoreSiblings option is useful for when the element that will have the animations applied to already has a <span> element within it.

The retainHoverOn is useful for when you have another element inside the trigger element that causes something else to happen, a popup to appear for example, and you’d like the animated hover state to remain on even when the pointer moves into the other element

27 Responses to “Plugin Update: hoverfade-1.0.2”

  1. [...] This post was mentioned on Twitter by Dan Wellman, dsaportfolio. dsaportfolio said: RT @danwellman: #jQuery plugin hoverFade updated, with examples: http://www.danwellman.co.uk/plugin-update-hoverfade-1-0-2/ enjoy :D [...]

  2. Joe says:

    I am posting here because your contact tab is not working for me……. I went to your Rigby site and the menu system across the top wasn’t working right for me. If i scrolled straight down the menu would disappear before it could hover over an item. I could only get it to stay if i scrolled down diagonally

  3. Dan Wellman says:

    Hi Joe, yeah, the contact tab is a bit flakey at the moment, just haven’t had time to update it. It works intermittently…

    What browser were youy using on the Rigby site? It works perfectly for me on FF 3.6..?

    I built the site originally, but it was built while I worked for MAD productions and I no longer work there so it’s possible someone else has updated it. There’s absolutely nothing I can do to fix it if it is broken however…

  4. [...] HoverFade ( Demo | Download ) The plugin is designed to be used with navigation menus, where each menu item is made from an anchor element within a list-item element. You can apply the effect to different collections of elements by supplying new trigger and faderTemplate options. [...]

  5. [...] HoverFade ( Demo | Download ) The plugin is designed to be used with navigation menus, where each menu item is made from an anchor element within a list-item element. You can apply the effect to different collections of elements by supplying new trigger and faderTemplate options. [...]

  6. Very efficiently written article. It will be helpful to anybody who employess it, as well as me. Keep up the good work – for sure i will check out more posts.

  7. [...] jQuery jQuery Plugin – hoverFade [...]

  8. [...] HoverFade ( Demo | Download ) The plugin is calculated to be used with navigation menus, where each menu item is made from an anchor element within a list-item element. You can apply the effect to different collections of elements by supplying new trigger and faderTemplate options. [...]

  9. Dan Wellman » Plugin Update: hoverfade-1.0.2…

    The plugin is designed to be used with navigation menus, where each menu item is made from an anchor element within a list-item element. You can apply the effect to different collections of elements by supplying new trigger and faderTemplate options….

  10. yiannis says:

    Im very glad to listen to this. This is very nice :).

  11. Awesome Menu original that change from traditional one thnks for sharing your work you are an artist

  12. [...] the metadata attribute settable on the extruder container.Stay-On-Top Menu ( Demo | Download ) HoverFade ( Demo | Download ) The plugin is designed to be used with navigation menus, where each menu item [...]

  13. It must have put a lot of work to do this site.It is useful for me.

  14. [...] / 配布元サイトはこちらです。 [...]

  15. Miracle Drivar says:

    Awesome Menu original that change from traditional one thnks for sharing your work you are an artist

  16. news says:

    When I open up your Feed it appears to be a lot of garbage, is the problem on my part?

  17. Dan Wellman says:

    The feed is controlled by feedburner. I just checked and it looks ok to me. Are you using a reader or viewing the feed through a browser..?

  18. [...] hoverFade入手先:Dan Wellman [...]

  19. sarah says:

    Great! thanks for plugin, I’ll use it in my current project.

  20. Awesome this is really a great post and big help, i will use this plugin every where whenever required…hats off.

  21. zavera says:

    I’m stunned with this plugin project update, thanks for original menu wanted to have it!

  22. Sunny says:

    amazing plugin apdate, thanks for share, it was helpful.!

Leave a Reply

My Books