Replicate this rollover (example):

Hey guys, first post here, I am hoping I can have some guidance trying to create a very similar rollover effect as this one:

www.sshvm.com

If there is jquery or javascript already available for this that would be great, or if you think I should start from scratch that’s fine I am experience in javascript but would appreciate some guidance. Thanks!

The technique used there is to add a CSS class name to element, in the case of the demo, to the section element.

It’s a two-step process.

  1. When one of the sections is hovered over, the CSS class name specifying the active panel is removed from all of them.
  2. Then, the CSS class name specifying the active panel is added to the one that is being hovered over.

Let’s see if we can find out how they do it on their site.
Aha, here it is in their code, in the saas.js file, and it’s exactly as described.


var $gridSections = $grid.find('section');
$gridSections.hover(function () {
    $gridSections.removeClass('on');
    $(this).addClass('on');
});

They use ‘on’ there, but typically in practice you would use a term that more appropriately describes the intent, such as ‘active’