alex
alex

Reputation: 235

Jquery Slider : Object [object Object] has no method 'slider'?

I am probably missing something trivial but I cannot find any flaw, I have a Jquery UI slider

$(function()
        {
            $("#slider").slider(
                {
                    min : 0,      // Have a box that just takes in the price
                    max : 500,
                    change: function(event,ui)
                    {
                        $( "#amount" ).val( "$" + ui.value );
                    }
                });
            $("#amount").val( "$" + $("#slider").slider("value") );
        });

my html code is

<label for="amount">Your Price:</label> 
<input type="text" id="amount" style="border: 0; font-weight: bold;" />
<div id="slider" class="slider"></div>

but my slider does not display , I keep getting this error in chrome

Uncaught TypeError: Object [object Object] has no method 'slider' 

I have also included the jquery header files

<script type="text/javascript" src="js/jquery-1.7.2.js"></script>

any help would be appreciated!

Upvotes: 0

Views: 1413

Answers (1)

thecodeparadox
thecodeparadox

Reputation: 87073

You need to include the jQuery UI plugin for slider after jQuery include. That is:

<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="PATH_TO_JQUERY_UI"></script>

Upvotes: 1

Related Questions