5

I can't get jQueryUI slider working on Wordpress. I got the following HTML structure:

<input type="text" name="TPSP[numberOfPosts]" id="numberOfPosts" value="<?php $args['options']['numberOfPosts']; ?>" />
<div id="NOP_slider"></div>​​​​​​​​​​

And the following jQuery function:

jQuery(function($) {
    var numberOfPosts = AdminPageOptions.numberOfPosts;
    $( "div#NOP_slider" ).slider({
        value:numberOfPosts,
        min: 0,
        max: 10,
        step: 1,
        slide: function( event, ui ) {
            $( "#numberOfPosts" ).val( ui.value );
        }
    });
    $( "#numberOfPosts" ).val( $( "#NOP_slider" ).slider( "value" ) );
})​

But Wordpress doesn't show the div#NOP_slider as a slider and I can't use it. I tried also to deregister the WordPress-owned jQueryUI and to register a custom version of it which I downloaded from the jQueryUI website, but nothing changed. Is there a way to get it to work properly?

Thanks in advance.

Nmk
  • 1,281
  • 2
  • 14
  • 25
basteez
  • 477
  • 1
  • 5
  • 15

0 Answers0