Skip to content
CMO & CTO
CMO & CTO

Closing the Bridge Between Marketing and Technology, By Luis Fernandez

  • Digital Experience
    • Experience Strategy
    • Experience-Driven Commerce
    • Multi-Channel Experience
    • Personalization & Targeting
    • SEO & Performance
    • User Journey & Behavior
  • Marketing Technologies
    • Analytics & Measurement
    • Content Management Systems
    • Customer Data Platforms
    • Digital Asset Management
    • Marketing Automation
    • MarTech Stack & Strategy
    • Technology Buying & ROI
  • Software Engineering
    • Software Engineering
    • Software Architecture
    • General Software
    • Development Practices
    • Productivity & Workflow
    • Code
    • Engineering Management
    • Business of Software
    • Code
    • Digital Transformation
    • Systems Thinking
    • Technical Implementation
  • About
CMO & CTO

Closing the Bridge Between Marketing and Technology, By Luis Fernandez

Effects with Restraint: UX without Annoyance

Posted on May 24, 2010 By Luis Fernandez

Effects are candy. Annoyance is poison. jQuery makes it easy to add slide and fade to everything on a page. That power is tempting. Ship a dropdown that swooshes. Animate icons. Nudge a panel into view. Then someone opens your site on a slow laptop with an old browser and the whole thing feels sticky. Or they hit your form and the animation fights them. That is the moment where the candy turns into noise.

I build sites for real people and I keep running into the same pattern. Effects help when they set the right pace. They hurt when they grab the wheel. Today I want to share a simple frame and three cases where jQuery effects make sense without the annoyance tax. These are small patterns that have held up on IE six and seven, Firefox, Chrome, and phones that just got better JavaScript. No crystal ball. Just field notes from this month of client work and reader mail.

Problem framing

We reach for effects to solve three things. Explain what changed. Guide focus. Keep the page feel alive. All good goals. The trap is piling on motion that hides state, blocks input, or burns time. On a fresh Macbook that is a shrug. On a friend’s work PC that is a rage quit. Speed is part of UX and jQuery lets us control it, not just add sugar.

The core rule I use on every effect:

  • Make it reversible. The user can undo the effect instantly.
  • Make it cancelable. New intent cancels old motion.
  • Make it optional. The page still works with no script.

Three cases you can ship this week

Case one. Navigation that does not jitter

Hover menus still pay the bills. The common fail is flicker. You drift the pointer across the gap and the submenu hides then shows then hides again. The fix is tiny. Add a small pause and kill queued animations so the menu responds to intent, not noise.

// jQuery 1.4 friendly
$(function() {
  var showDelay = 120;
  var hideDelay = 200;

  $('.navMenu .parent').each(function() {
    var timer;
    var $parent = $(this);
    var $submenu = $parent.find('.submenu');

    $parent
      .mouseenter(function() {
        clearTimeout(timer);
        $submenu.stop(true, true).fadeIn(showDelay);
      })
      .mouseleave(function() {
        clearTimeout(timer);
        timer = setTimeout(function() {
          $submenu.stop(true, true).fadeOut(hideDelay);
        }, hideDelay);
      });
  });
});

Notes that matter. stop true true kills the queue and jumps to the final state so you do not stack animations. The slight delay respects people who move the pointer with a normal arc. It also plays nice on older IE where paint time is more expensive. And if script fails, a basic CSS rule can show the submenu on focus, so keyboard nav still works.

Case two. Form feedback that helps instead of nags

Inline validation is great when it gives a nudge and stays quiet after the fix. The mistake is red text that fades in and out while the user types. Better to react on blur or submit and keep messages stable.

$(function() {
  function showMsg($field, msg, type) {
    var $msg = $field.data('msgEl');
    if (!$msg) {
      $msg = $('')
        .hide();
      $field.after($msg);
      $field.data('msgEl', $msg);
    }
    $msg
      .text(msg)
      .attr('dataType', type)
      .stop(true, true)
      .fadeIn(120);
  }

  function clearMsg($field) {
    var $msg = $field.data('msgEl');
    if ($msg) $msg.stop(true, true).fadeOut(100);
  }

  $('form.validate').delegate('input.required, textarea.required', 'blur', function() {
    var $f = $(this);
    if ($.trim($f.val()) === '') {
      showMsg($f, 'This field is required', 'error');
    } else {
      clearMsg($f);
    }
  });

  $('form.validate').submit(function(evt) {
    var ok = true;
    $(this).find('input.required, textarea.required').each(function() {
      var $f = $(this);
      if ($.trim($f.val()) === '') {
        showMsg($f, 'Please fill this in', 'error');
        ok = false;
      }
    });
    if (!ok) {
      evt.preventDefault();
    }
  });
});

Keys to the mood. No shake. No bounce. No modal. Messages fade in fast then stay put until fixed. We bind with delegate so fields added later still get rules. And we use polite status so screen readers do not get flooded. That is progressive enhancement in real life, with jQuery doing the heavy lifting only when present.

Case three. Reveal content without a carousel hangover

Carousels eat time on old machines and break deep links. For many pages a simple reveal beats a slider. Link shows more text. Link hides it again. That is it. If you want a deep link, use a hash and check it once on load.

$(function() {
  $('.reveal').each(function() {
    var $wrap = $(this);
    var $btn = $wrap.find('.revealToggle');
    var $content = $wrap.find('.revealBody');

    function setState(expanded) {
      $btn.attr('ariaExpanded', expanded);
      if (expanded) {
        $content.stop(true, true).slideDown(150);
      } else {
        $content.stop(true, true).slideUp(150);
      }
    }

    $btn.click(function(evt) {
      evt.preventDefault();
      var expanded = $btn.attr('ariaExpanded') === 'true';
      setState(!expanded);
    });

    // hash based open
    if (location.hash && $wrap.attr('id') === location.hash.slice(1)) {
      setState(true);
    } else {
      $content.hide();
      $btn.attr('ariaExpanded', 'false');
    }
  });
});

We keep the control as a real link, so no script still lands you at the right spot. slideUp and slideDown with stop give a clear state change without wasting time. And the hash makes it shareable, which search bots like.

Objections and replies

  • We need more flash or it looks dated. Trendy motion will not save a slow page. People on phones with spotty signal or a work laptop will bounce if the page drags. If you want delight, ship micro moves that also make the task faster. Instant cancel, no queue, quick in and out.
  • Old IE will glitch anyway, so why bother with subtlety. jQuery smooths many rough edges. You still win by keeping the DOM light and the animation targets small. Fewer paints and no stacked queues means fewer tears on IE six and seven.
  • No one notices subtle effects. People notice when a site lets them finish the task on the first try. That means form hints that show at the right time, menus that do not jitter, and reveals that do not break the back button. The effect is the means, not the show.
  • Plugins solve this. Some do. Many bring features you do not need and more weight. For common tasks a dozen lines with stop and a delay beats a big plugin. If you bring a plugin, audit the size and the defaults. Turn off autoplay, turn off infinite loops, and watch the queue.

Small extras that pay off

Two tiny patterns make effects safer across the board.

Use one event source. Bind to a static parent and let events bubble. That cuts the number of handlers in half and helps with content added later.

// one place to listen
$('.app').delegate('.btn', 'click', function(evt) {
  evt.preventDefault();
  // action
});

Respect user intent over timers. If a new action starts, cancel the old one. This one line keeps the app snappy.

// cancel old animation and jump to end, then start fresh
$el.stop(true, true).fadeIn(120);

Action checklist you can run today

  • Pick one effect per task. Menu gets fade. Form gets a crisp message. Reveal gets a slide. No stacks.
  • Cap durations. Keep motion in the 100 to 200 range. Faster on hover, slightly slower on show hide actions.
  • Kill queues with stop true true on every interactive effect.
  • Bind with delegate to stable parents so future content behaves the same.
  • Test on a slow box. Open IE seven on a basic PC or an old netbook. If it feels sticky, trim targets and shorten durations.
  • Check no script. Links still link. Forms still submit. Content is present in the markup.
  • Watch weight. jQuery is already on many pages. If you add a plugin, measure the cost. Remove what you do not need.
  • Use polite status for messages to keep assistive tech calm.

jQuery gives us a handy way to explain change, move focus, and add a hint of life. The trick is restraint. Fast in. Fast out. Cancel on new intent. And always leave the door open for the person who just wants to finish the task. If we get that right, the page feels modern without shouting. It also ages better, which is nice since we will be supporting these projects long after the launch party.

If you try the patterns above and hit a snag, send a note with a quick link. I am happy to look at a menu that jitters or a form that nags. We can tune it together. The answer is almost always fewer lines, not more.

Effects with restraint. That is the move. jQuery does the rest.

Software Architecture Software Engineering

Post navigation

Previous post
Next post
  • Digital Experience (94)
    • Experience Strategy (19)
    • Experience-Driven Commerce (5)
    • Multi-Channel Experience (9)
    • Personalization & Targeting (21)
    • SEO & Performance (10)
  • Marketing Technologies (92)
    • Analytics & Measurement (14)
    • Content Management Systems (45)
    • Customer Data Platforms (4)
    • Digital Asset Management (8)
    • Marketing Automation (6)
    • MarTech Stack & Strategy (10)
    • Technology Buying & ROI (3)
  • Software Engineering (310)
    • Business of Software (20)
    • Code (30)
    • Development Practices (52)
    • Digital Transformation (21)
    • Engineering Management (25)
    • General Software (82)
    • Productivity & Workflow (30)
    • Software Architecture (85)
    • Technical Implementation (23)
  • 2025 (12)
  • 2024 (8)
  • 2023 (18)
  • 2022 (13)
  • 2021 (3)
  • 2020 (8)
  • 2019 (8)
  • 2018 (23)
  • 2017 (17)
  • 2016 (40)
  • 2015 (37)
  • 2014 (25)
  • 2013 (28)
  • 2012 (24)
  • 2011 (30)
  • 2010 (42)
  • 2009 (25)
  • 2008 (13)
  • 2007 (33)
  • 2006 (26)

Ab Testing Adobe Adobe Analytics Adobe Target AEM agile-methodologies Analytics architecture-patterns CDP CMS coding-practices content-marketing Content Supply Chain Conversion Optimization Core Web Vitals customer-education Customer Data Platform Customer Experience Customer Journey DAM Data Layer Data Unification documentation DXP Individualization java Martech metrics mobile-development Mobile First Multichannel Omnichannel Personalization product-strategy project-management Responsive Design Search Engine Optimization Segmentation seo spring Targeting Tracking user-experience User Journey web-development

©2025 CMO & CTO | WordPress Theme by SuperbThemes