Jump to content

Color Fade


slj90
Go to solution Solved by slj90,

Recommended Posts

I have a navigation bar that allows the user to change its color. When the color is changed it fades from one color to another. I am trying to make the background do the same. It currently changes color but doesn't have the same fade effect.

 

Navigation Bar:

	var value = $(this).attr('data-color');
		$('.navbar').removeClass().addClass('navbar '+ value);
		
		return false;

Page Background:

function colorPink() {
 document.body.style.backgroundColor = "#FF47D1";
}

What can I do to make them both fade?

Thanks,

Link to comment
Share on other sites

  • Solution
-webkit-transition: all 300ms ease-in-out;

-moz-transition: all 300ms ease-in-out;

-ms-transition: all 300ms ease-in-out;

-o-transition: all 300ms ease-in-out;

transition: all 300ms ease-in-out;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.