Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bfintal opened this issue Feb 20, 2016 · 9 comments
Closed

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

bfintal opened this issue Feb 20, 2016 · 9 comments

Comments

@bfintal
Copy link

@bfintal bfintal commented Feb 20, 2016

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?

@desaintmartin
Copy link

@desaintmartin desaintmartin commented Sep 15, 2016

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

@mehmetalidumlu
Copy link

@mehmetalidumlu mehmetalidumlu commented Sep 19, 2016

I have same problem :/
Has anybody solved it?

@fega
Copy link

@fega fega commented Apr 10, 2017

@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.

@fega fega closed this Apr 10, 2017
@qantumthemes
Copy link

@qantumthemes qantumthemes commented Jun 19, 2017

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)

@qantumthemes
Copy link

@qantumthemes qantumthemes commented Jun 19, 2017

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)

@frmsaul
Copy link

@frmsaul frmsaul commented Feb 16, 2018

This is still broken :(

Whats the standard workaround for this problem?

@fega
Copy link

@fega fega commented Feb 17, 2018

@Dogfalo maybe is a good idea reopen this?

@Dogfalo
Copy link
Owner

@Dogfalo Dogfalo commented Feb 18, 2018

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');
@frmsaul
Copy link

@frmsaul frmsaul commented Feb 20, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.