Solved

UI slider - jquery - smoothing out - working with opacity

Posted on 2008-10-08
3
997 Views
Last Modified: 2008-10-09
I am working on my site here: http://www.ryancoughlin.com/ and if you see at the bottom the slider, i am using a part of the UI jQuery docs here for it: http://docs.jquery.com/UI/Slider

I am using it to change the opacity of the content up top (if you click the + sign you will see what I mean, then play with the slider)

Right now it is very rough in changing, if you go to the end or the beginning. As in if you go all the way to the end it goes the light gray, where it should be black.

 I am trying to find a way to smooth it out. Right now in my CSS I have:

#panel_contents {
    background: black;
    filter:alpha(opacity=85);
    -moz-opacity:0.85;
    -khtml-opacity: 0.85;
    opacity: 0.85;
    height: 100%;
    width: 100%;
    position: absolute;
    z-index: -1;
}

That contains the styles for the box that slides down. And I am just adjusting:

    -moz-opacity:0.85;

Should I do all of the others as well? My jQuery is here for the slider:

http://pastie.org/287878

Any ideas on what I can do?

Thanks,

Ryan

0
Comment
  • 2
3 Comments
 
LVL 16

Expert Comment

by:sh0e
ID: 22676660
The min and max has defaulted to 0 to 100, because minValue/maxValue have been changed to min/max.
So, at the end of the slider, it becomes .100 (which is why it is white).

It is no longer minValue and maxValue, but min and max.

//line 4-5

//			minValue: .0,

//			maxValue: .98,

min: .0,

max: .98,

Open in new window

0
 
LVL 16

Accepted Solution

by:
sh0e earned 500 total points
ID: 22676724
Ok, understanding what you tried to do now.  Adding the "." does not work.  1-9 becomes .1 to .9
		$('#slider_callout').hide();

		$('.slider_bar').slider({

			handle: '.slider_handle',

			min: 0,

			max: 100,

			start: function(e,ui){

				$('#slider_callout').fadeIn('fast');

				console.log("started");

			},

			stop: function(e,ui){

				$('#slider_callout').fadeOut('fast');

			},

			slide: function(e,ui){

				$('#panel_contents').css('-moz-opacity', ui.value/100.00).text(ui.value);

				console.log(ui.value);

			}

		});

Open in new window

0
 
LVL 1

Author Comment

by:catonthecouchproductions
ID: 22678523
So changing the minValue to min and adding in the math you put it, fixed it up?

Thank you for your help!

Ryan
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now