Difference between revisions of "Template:Copenhagen-Header"

Line 883: Line 883:
 
});
 
});
  
$(function () {
 
  $('[data-toggle="tooltip"]').tooltip()
 
})
 
  
  $(document).ready(function() {
+
$(function() {
        var hasToolTip =false;
+
            $( document ).tooltip({
        $('#password').on({
+
                items: "input",
            "click": function() {
+
                content: function() {
                hasToolTip = true;
+
                    return $('.myPopover').html();
                $(this).tooltip({ items: "#password", content: "Displaying on click"});
+
                },
                $(this).tooltip("open");
+
                position: {
            },
+
                    my: "center bottom-20",
            "mouseout": function() {     
+
                    at: "center top",
                if(hasToolTip)
+
                    using: function( position, feedback ) {
                {
+
                        $( this ).css( position );
                    $(this).tooltip("disable");  
+
                        $( "<div>" )
                     hasToolTip = false;
+
                                .addClass( "arrow" )
                 }                                                  
+
                                .addClass( feedback.vertical )
             }
+
                                .addClass( feedback.horizontal )
        });
+
                                .appendTo( this );
    });
+
                     }
 +
                 }
 +
             });
  
$(document).ready(function () {
+
            $('.fireTip').click(function () {
    $( document ).tooltip( {
+
                if(!$(this).hasClass('open')) {
        track:    true,
+
                    $('#age').trigger('mouseover');
        content:  function() {
+
                    $(this).addClass('open');
            return  $( this ).attr( "title" );
+
                } else {
        }
+
                    $('#age').trigger('mouseout');
    });     
+
                    $(this).removeClass('open');
    $('div').click(function(){
+
                }
        $('#show').html($('#' + $(this).attr('aria-describedby')).children().html());
+
    });
+
});
+
  
 +
            })
  
var id = "#tt";
+
         });
var $elem = $(id);
+
 
+
$elem.on("mouseenter", function (e) {
+
    e.stopImmediatePropagation();
+
});
+
 
+
$elem.tooltip({ items: id, content: "Displaying on click"});
+
 
+
$elem.on("click", function (e) {
+
   
+
    $elem.tooltip("open");
+
});
+
 
+
 
+
$elem.on("mouseleave", function (e) {
+
    e.stopImmediatePropagation();
+
});
+
          
+
 
+
$(document).mouseup(function (e) {
+
    var container = $(".ui-tooltip");
+
    if (! container.is(e.target) &&
+
        container.has(e.target).length === 0)
+
    {
+
        $elem.tooltip("close");
+
    }
+
});
+
  
 
</script>
 
</script>

Revision as of 08:31, 31 October 2017