Materialize: Uncaught Error: Method value does not exist on jQuery.tooltip

Created on 20 Feb 2016  路  9Comments  路  Source: Dogfalo/materialize

Hi, I encountered an error regarding $.fn.slider in materialize.js and WordPress Core's color picker:

Here's the JS error for reference:

Uncaught Error: Method value does not exist on jQuery.tooltip

stemmed from the $.error in these lines:

$.fn.slider = function(methodOrOptions) {
  if ( methods[methodOrOptions] ) {
    return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
  } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
    // Default to "init"
    return methods.init.apply( this, arguments );
  } else {
    $.error( 'Method ' +  methodOrOptions + ' does not exist on jQuery.tooltip' );
  }
}; // Plugin end

Edit: Dug through WP's code, the error occurs when WP's Iris color picker calls:

controls.stripSlider.slider( 'value', value );

stripSlider though is created using jQuery-UI. So I think the conflict is from Materialcss & jQuery-UI.

Would it be possible to namespace Materialcss's slider function?

Most helpful comment

@Dogfalo maybe is a good idea reopen this?

All 9 comments

I can confirm using Materialize and jQuery-UI (not Wordpress). Calling $('.myslider').slider("value"); results in this exception.

I have same problem :/
Has anybody solved it?

@bfintal @desaintmartin @mehmetalidumlu
Could someone check if this is still an issue with the latest version?, also, please provide a codepen to reproduce the issue

Closed due inactivity, feel free to reopen it if it is still necessary.

Hello!

Still an issue on latest version, just try to call any method of slider requiring arguments and will reproduce the issue, no need to spend 15 minutes for a codepen ;)
Just try
$(".YourSlider").slider('sliderTo',1);

Next and prev doesn't give errors, only when a second argument is passed you'll see the "tooltip" error popping.
The slider works as usual until you try skipping to a slide (for a custom index for example).

My code

$('.qt-material-slider').each(function(i,c){
            var that = $(c);

            that.find(".prev").click(function(){
                that.slider("prev");
            });
            that.find(".next").click(function(){
                that.slider("next");
            });

            that.find("[data-qtslidegoto]").click(function(e){
                e.preventDefault();
                var togo = $(this).attr("data-qtslidegoto");
                //that.slider("prev");
                console.log(togo);
                //that.moveToSlide(togo);
                that.slider('sliderTo',togo);
                 //
                // console.log( that.slider);
            });

        });

Error code (line 710 is the one quoted above)

Uncaught Error: Method sliderTo does not exist on jQuery.tooltip
at Function.error (jquery.js:2)
at a.fn.init.a.fn.slider (materialize.min.js:9)
at HTMLAnchorElement. (qt-main.js:710)
at HTMLAnchorElement.dispatch (jquery.js:3)
at HTMLAnchorElement.r.handle (jquery.js:3)

update, jQuery tooltip has nothing to do, is a wrong message on slider.js line 321

$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );

I think maybe the method moveToSlide is not public? (i'm not so good to fix this, sorry)

This is still broken :(

Whats the standard workaround for this problem?

@Dogfalo maybe is a good idea reopen this?

MoveToSlide and sliderTo are not slider supported methods. These are the supported methods:

// Pause slider
$('.slider').slider('pause');
// Start slider
$('.slider').slider('start');
// Next slide
$('.slider').slider('next');
// Previous slide
$('.slider').slider('prev');

@Dogfalo
How should one access the current value of the slider?
Which method supports that functionality?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bradley-varol picture bradley-varol  路  3Comments

heshamelmasry77 picture heshamelmasry77  路  3Comments

serkandurusoy picture serkandurusoy  路  3Comments

locomain picture locomain  路  3Comments

ReiiYuki picture ReiiYuki  路  3Comments