Bootstrap pop-up box (PopOver) support mouse to move to the pop-up layer on the window layer does not hide the reasons and solutions _javascript skills

Source: Internet
Author: User

The pop-up box (PopOver), like a ToolTip (Tooltip), provides an expanded view. If you want to activate the pop-up box, the user simply hover the mouse over the element. The contents of the pop-up box are completely populated with the Bootstrap Data API (BOOTSTRAP). This method relies on ToolTips (tooltip).

1 set delay, more than the time delay is not moved into the window, the window is hidden

Tooltip.prototype.init = function{
var triggers = This.options.trigger.split (") followed by
//Set delay
if ( This.options.trigger.indexOf (' hover ') >-1) {
$.extend (true, this.options, {delay: {hide:100}});

2 control does not disappear code

In Tooltip.prototype.enter = function (obj) {

Cleartimeout (Self.timeout) after joining

if (self.options.trigger.indexOf (' hover ') >-1) {
self. $tip. Unbind (' MouseEnter '). Bind (' MouseEnter ', function
Self.hoverstate = ' in ';
}). Unbind (' MouseLeave '). Bind (' MouseLeave ', function (e) {
self.hoverstate = ' out ';
Self.timeout = settimeout (function () {
if (self.hoverstate = ' out ') self.hide ()
}, Self.options.delay.hide) c10/>})
}

  Bootstrap version: v3.3.6

Let's Add the pop-up box (popover) usage

The pop-up box (popover) plug-in generates content and markup based on requirements, and by default, the pop-up box (PopOver) is placed behind their triggering elements. You can add a pop-up box (PopOver) in the following two ways:

With the Data property: To add a pop-up box (popover), simply add data-toggle= "PopOver" to an anchor/button tag. The title of the anchor is the text of the pop-up box (PopOver). By default, the plug-in sets the pop-up box (PopOver) to the top.

<a href= "#" data-toggle= "PopOver" title= "Example popover" >
please hover over my top
</a>

Through JavaScript: Enable pop-up box (PopOver) via javascript:

$ (' #identifier '). PopOver (Options)

The pop-up box (popover) plugin is not a pure CSS plug-in, unlike the Drop-down menus and other plug-ins discussed earlier. To use this plug-in, you must use jquery to activate it (read JavaScript). Use the following script to enable all pop-up boxes on the page (popover):

$ (function () {$ (' [data-toggle= ' popover '] '). PopOver ();});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.