How does this slider work?
http://jqueryui.com/demos/slider
source given shows up nothing
<style>
#demo-frame > div.demo { padding: 10px !important; }
</style>
<script>
$(function() {
$( "#slider" ).slider();
});
</script>
<div class="demo">
<div id="slider"></div>
</div><!-- End demo -->
I did include jquery before adding this
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
but it gives me
SCRIPT438: Object doesn’t support property or method ‘slider’
error.
This is what entire code looks like
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<style>
#demo-frame > div.demo { padding: 10px !important; }
</style>
<div class="demo">
<div id="slider"></div>
</div><!-- End demo -->
<script>
$(function() {
$( "#slider" ).slider();
});
</script>
</body>
</html>
What am I missing?
You did include jQuery… but you are using
jQuery uiplugin method-.slider()without referencing the ui plugin.So that method
slideris unknown to javascript,Add the reference after the jQuery library:
Update:
After too much time spent, I’ve found your problem, you’re missing the JQuery ui css:
JSFiddle DEMO