- To create a slider
- To create a div that will fade to a percent dependent on the sliders position.
I was inspired by the 52 weeks of code challenge but this is something I want to do for my website. I don't believe I completely understand jquery yet.
My code so far: (NOTE: some pieces of this segement of code came from jquery.com )
<!DOCTYPE html>
<html>
<head>
<link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.slider.js"></script>
<style type="text/css">
#slider { margin: 10px; }
</style>
<script type="text/javascript">
$(document).ready(function(){
$("#slider").slider();
$('.selector').slider({ min: 0 });
$('.selector').slider({ max: 1 });
var block = $('.selector').slider('option', 'block');
$("div").click(function() {
$(this).fadeTo("slow", "#block");
});
});
</script>
</head>
<body style="font-size:62.5%;">
<br><br><bR>
<div id="slider"></div>
<br><br><bR><div id="tester">This is a test</div>
</body>
</html>
I know its setup to where you have to click inside the div to get it to fade. I didn't know what I should put there to get it to automatically adjust.
This post has been edited by Blade2021: 08 January 2010 - 01:15 PM

New Topic/Question
Reply



MultiQuote


|