Note that there are some explanatory texts on larger screens.

plurals
  1. POswitchClass failing after jQuery hover function on jQuery cycle element
    text
    copied!<p>I have a page using the jQuery cycle plugin for a sliding banner, and inside each slide is a div (<code>#info</code>) whose background colour is animated on hover.</p> <p>I'm also trying to use switchClass to switch between three color-schemes on the page and this also changes the background colour of <code>#info</code>, which works great until the hover on <code>#info</code> fires, after which the switchClass buttons no longer work.</p> <p>Here's the jQuery for the hover:</p> <pre><code>$('#info.default').hover(function(){ $('#info.default').stop().animate({backgroundColor: '#CDBF21'}, 300); $('#info.default .description').stop().animate({color: '#444'}, 300); }, function() { $('#info.default').stop().animate({backgroundColor: '#203E52'}, 300); $('#info.default .description').stop().animate({color: '#fff'}, 300); }); </code></pre> <p>And here are the switchClass parts:</p> <pre><code>$('.coral-green-button').click(function(){ $('#info.default').stop().switchClass("default", "coral-green", 1000 ); $('#info.green-blue').stop().switchClass("green-blue", "coral-green", 1000 ); }); $('.green-blue-button').click(function(){ $('#info.coral-green').stop().switchClass("coral-green", "green-blue", 1000 ); $('#info.default').stop().switchClass("default", "green-blue", 1000); }); $('.mustard-blue-button').click(function(){ $('#info.coral-green').stop().switchClass("coral-green", "default", 1000); $('#info.green-blue').stop().switchClass("green-blue", "default", 1000); }); </code></pre> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload