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

  • Home
  • SEARCH
  • 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 8656837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:22:38+00:00 2026-06-12T15:22:38+00:00

Here is a JSFIDDLE about my problem. I want to drag the slider (with

  • 0

Here is a JSFIDDLE about my problem.

I want to drag the slider (with speech bubble above it) left and right. As it slides between the blue and green colours on the bar behind it, it will set the opacity of image 1 to 90% and the opacity of image 2 to 10%, image1 80% image 2 20%, image 1 70% - image2 30% etc till the slider reaches end of green and the opacity of image 1 is set to 0% and image 2 to 100%, then as the slider keeps sliding to the right, from green to red, image 2 reaches 0% and image 3 is 100%. Repeat with the next image.

I’ve looked at http://jqueryui.com/demos/slider/ which seems to do what I want, but I’m not sure how to get the X position of the slider, then apply that to the opacity of image1, image2, image3, image4.

The slider is 960px wide, so 960 / 4 = 240, for each 240 pixels along the slider the opacity needs to be set from 0-100%.

Firstly, is this possible in jquery? Secondly, can anyone help with the code or show me some links which may help?

  • 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-06-12T15:22:39+00:00Added an answer on June 12, 2026 at 3:22 pm
    <!doctype html>
    
    <html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>jQuery UI Slider</title>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
        <script src="http://code.jquery.com/jquery-1.8.2.js"></script>
        <script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
        <link rel="stylesheet" href="/resources/demos/style.css" />
        <script>
        $(function() {
            $( "#slider" ).slider({
    
            range: "min",
                     value: 0,
                     min: 0,
                     max: 10,
    
                     slide: function (event, ui) {
                         var r = (ui.value); 
                         $("#img1").css({'opacity':r/10});
                         $("#img2").css({'opacity':1-(r/10)});
    }   
        })
        });
        </script>
    </head>
    <body>
    <img id = "img1" src = "http://www.gettyimages.com/images/marketing/frontdoorStill/PanoramicImagesRM/FD_image.jpg" style = "height:200px; width:200px">
    <img id = "img2" src = "http://www.gettyimages.com/images/marketing/frontdoorStill/PanoramicImagesRM/FD_image.jpg" style = "height:200px; width:200px">
    <div id="slider" style = "height:10px; width:400px" ></div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE: Demo of problem here: http://jsfiddle.net/fdB5Q/embedded/result/ From about 767px to 998px, the form fields
look here: http://jsfiddle.net/QTrat/10/ I want to stretch the red box to the floated children
Ok here's the problem: In my index page I have 4 tabs menu, Home/Contact/About/Faq
Helly guys, first here the jsfiddle example and here my problem. I have 3
My script is here : jsfiddle i have two attributes in my form that
What solution can I find to prevent unnecessarily clicks activate function mouseup. here jsfiddle
here is jsfiddle sample - http://jsfiddle.net/6bKHc/120/ and code - var move, inter; inter =
Here is jsfiddle ! I am trying to make user page where he can
my JSfiddle is here http://jsfiddle.net/hhimanshu/VAAKf/3/ When i click on search, it doesn't do anything,
My jsfiddle is here- http://jsfiddle.net/hhimanshu/HVRLA/ Need - As soon as text is entered the

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.