Turn Off JQuery UI tooltip and need to used regular tooltip within a page - jquery-ui

I have JQuery in my application. But I want to Turn Off Jquery script for tool tip and want to use regular tool tip in tag
I followed this document and tried disable, hide all properties. Its hiding and whole <a> element https://api.jqueryui.com/tooltip/
Plese find myJSFiddler here: Code
$(function () {
$(document).tooltip({
content: function () {
return $(this).prop('title');
}
});
});
Please let me know how can I get regular Tooltip instead of styling tooltip

If you do not assign ToolTip, it will not initialize.
If you want to initialize it, but also disable it, you can use the disable method: https://jsfiddle.net/Twisty/0w278gLj/4
$(function() {
//$("body").tooltip().tooltip("disable");
});
See More: https://api.jqueryui.com/tooltip/#method-disable

Related

Metronic Tooltip not working

I am using the metronic 5 and I tried to add tooltip with data-toggle="m-tooltip" with title="Some Title"
When the page is rendered and I hover on the element, the tooltip is triggered, but a class show is not added to the tooltip which is required to add opacity:1 to the element and get the element into view.
Can anyone suggest any change or Am I missing any script?
Thanks for the help.
Did you initialize the tooltips on your page?
$(function ()
{
$('[data-toggle="m-tooltip"]').tooltip()
});
https://getbootstrap.com/docs/4.0/components/tooltips/

How to also toogle a div outside a Bootstrap accordion

I am using Bootstrap accordion and I love the way it works in this example. However, I'd like to be able to toggle an additional section outside that accordion.
Is there a quick trick or should I try to develop my own widget?
Not sure about the bootstrap accordion, but you could add some simple jQuery:
$(".accordion-toggle").on(click, function() {
$(".other-section").toggle();
});
The trick is to bootstrap event hooks
"Bootstrap's collapse class exposes a few events for hooking into collapse functionality."
$('#myCollapsible').on('hidden', function () {
// do something…
})
Check doc here: twitter bootstrap collapse

Placing a twitter bootstrap tooltip on the right side

I want to display a tooltip using twitter bootstrap in rails. The tooltip is to be displayed on page load. So for doing this I have added the following in my markup of the field:
rel="tooltip" title="Press CTRL+C To Copy"
And then I have added the following code into my application.js file:
window.onload = function(){
var text_input = document.getElementById ('url_copy');
text_input.focus ();
text_input.select ();
$('#url_copy').tooltip('show')
}
Fortunately it's displaying the tooltip. Nut unfortunately it's displaying it on the top. But I want to place it on right. I know I have to use a placement: 'right' or something like that as mentioned http://twitter.github.com/bootstrap/javascript.html#tooltips
But how should the code exactly look like??
Thanks in Advance...
On the page that you linked it shows you examples.
To place it on the right use the following html.
Tooltip on right
http://twitter.github.com/bootstrap/javascript.html#tooltips

jQuery mobile add animation to collapsible-set

I would like to add an animation to collapsible set with jQuery Mobile.
Let me show a simple example of this:
<div id="tiles" data-role="collapsible-set" data-iconpos="right">
<div class="tile" data-role="collapsible" data-iconpos="right">blablabla</div>
<div class="tile" data-role="collapsible" data-iconpos="right">blablabla</div>
<div class="tile" data-role="collapsible" data-iconpos="right">blablabla</div>
</div>
jQuery Mobile handles this perfectly and shows me collapsible set of 3 items. What I want is ANIMATION, however I seem not to find anything in the docs.
I haven't tested yet how simple CSS animation(animating height property) would work, however is there a jQuery Mobile way of doing it like turning some internal flag ?
EDIT
I have tested out a simple jQuery animate method and it actually works. Just in case anyone else needs this. It runs smoothly even on my 528MHz Android phone on a default browser. A snippet I have added is really simple:
$( ".ui-collapsible-heading" ).live( "click", function(event, ui) {
$(this).next().css('height', '0').animate({
height: '100px'
});
});
Here ya go:
$('[data-role="collapsible"]').bind('expand collapse', function (event) {
$(this).find('p').slideToggle(500);
return false;
});​
I liked the idea you were going for so I played around with it a bit. This hooks into the way jQuery Mobile controls collapsible widgets so it's a bit less hacky then binding to the heading element.
The return false; stops the default behavior and the other line toggles the content in/out of view using the jQuery slideUp/slideDown animations. You could also use .fadeToggle() or roll your own animations. If you check event.type you can animate based on the event fired.
Here is a demo: http://jsfiddle.net/VtVFB/
Please note that in jQuery Mobile 1.4 and up you need to bind to the collapsibleexpand and collapsiblecollapse events instead of expand and collapse. So the complete code becomes
$('[data-role="collapsible"]').on('collapsibleexpand collapsiblecollapse', function(event) {
$(this).find('p').slideToggle(500);
return false;
});
​The code is not entirely right.
It overrides the default jquery mobile implementation of the expand collapse events,
but does not handle the change of the expand collapse icons.
A better code will be:
$('[data-role="collapsible"] h3:first').bind('click', function (event) {
$(this).next('p').slideToggle(500);
return false;
});​
The accepted answer doesnt account for that it doesnt change the collapsible cursor because of return false, so this is my answer working:
In my Project it was the contents relative to the [date-role="collapsible"] are $(this).find('>*:not(h3)')
/* animate collapsible-set */
$('[data-role="collapsible"]').on('expand', function (event) {
$(this).find('>*:not(h3)').each(function() {
if (!$(this).is(':visible')) {
$(this).stop().slideToggle();
}
});
}).on('collapse', function (event) {
$(this).find('>*:not(h3)').each(function() {
if ($(this).is(':visible')) {
$(this).stop().slideToggle();
}
});
});

How to hide jQuery UI Slider on blur?

I have an image that opens the jQuery UI Slider div on click and allows users to set a value by dragging the handle. What I'm trying to do now is hide that handle when the user clicks anywhere else on the page, but the regular .blur event doesn't seem to work.
$("#openPriceToSliderGif").click(function(){
$("#slider-vertical").show();
$("#slider-vertical").focus();
});
$("#slider-vertical").blur(function () {
$("#slider-vertical").hide();
});
Probably you will have a better luck on defining global onclick handler and there you need to check if source of event is not your slider. If not - do your magic.
Basically - if you spinner doesn't include element such as text field or link it will not support focus/blur
Ok, this is what I have put together to make this work.
Thanx DroidIn.net for your help.
$(document).bind("click", function(e){
if(e.target.id != "openPriceToSliderGif")
$("#slider-vertical").hide();
return false;
});
$("#openPriceToSliderGif").click(function(){
$("#slider-vertical").toggle();
});

Resources