Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7571815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:45:49+00:00 2026-05-30T15:45:49+00:00

Using jQuery and jQuery.Colors, I’ve been trying to come up with a way to

  • 0

Using jQuery and jQuery.Colors, I’ve been trying to come up with a way to associate the color of a background to an offset position as I’m scrolling a framed div.

You can view my example here:
http://coreycapetillo.com/tests/colors/index.html

Currently, I have the background-color changing when the offset position gets to a certain number range. However, I’m wondering if I can instead have it shift more organically, mimicking a solid-color-gradient effect.

I figured the simplest work-around would be to have 4 empty divs with 4 different background colors. Then use some basic math to set the opacity (using a different offset per div) to the offset().left number.

I’m looking for something that would require less empty DIVs and something much smoother. This is the first time I’ve posted on stackOverflow, so I hope I’ve provided enough information to get some guidance in the direction I need to go.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:45:50+00:00Added an answer on May 30, 2026 at 3:45 pm

    It may not be exactly the “gradient” effect you were after, but couldn’t you use the offset to set a class on one div (eg. at 100px, set class “green”, at 500px set class “blue”, etc), and use css transitions to handle the fading? See the example:
    http://jsfiddle.net/juanojeda/bKRuQ/

    This example uses clicks, but the principle is the same as listening on the offset event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using JQuery's jquery.animate-colors-min.js plugin I am trying to change the background color of some
I'm trying to get both a fadeIn (opacity toggle) and border fade (using jquery-animate-colors
I want to use .animate to change colors when .bind('click') is fired, using jquery
Using jQuery, what's the best way to find the next form element on the
Using jQuery, is there a way to select all tag that reference a specific
I'm using the jpicker jquery plugin for users to choose a color and the
Using jQuery and not CSS, is it possible to alternate row colors between records?
I'm trying to create a custom accordion using jquery, have read through quite a
I'm currently trying to build a filter search function using JQuery and Ajax. The
How can I pass a previously captured variable into a background property using jQuery?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.