0

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!

1
  • have you included the jquery ui header file? they are not the same Commented Aug 8, 2012 at 18:55

1 Answer 1

1

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>
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you , I did not notice the jquery UI script

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.