JQUERY - specc div goes out, wait, the div fades back

I currently have this working fiddle - http://jsfiddle.net/B8Abd/

I would like to use jquerys fade out, then fade during function. Code at the moment:

function changetoYellow() { //change the color of the div createGradientV([0, 0, 0], [255, 255, 0], 7, 200); } 

I would like to have something like this:

  function changetoYellow() { //fade to black: $("#fadeBandsV").fadeOut(1000); //change the color of the div createGradientV([0, 0, 0], [255, 255, 0], 7, 200); //fade from black: $("#fadeBandsV").fadeIn(1000); } 

Thanks.

+4
source share
1 answer

How about this:

 function changetoYellow() { $("#fadeBandsV").fadeOut(1000, function() { createGradientV([0, 0, 0], [255, 255, 0], 7, 200); $("#fadeBandsV").fadeIn(1000); }); } 

DEMO: http://jsfiddle.net/B8Abd/1/

+7
source

Source: https://habr.com/ru/post/1411774/


All Articles