BootStrap custom popover, click the implementation of the hidden area function, bootstrappover

Source: Internet
Author: User

BootStrap custom popover, click the implementation of the hidden area function, bootstrappover

When using bootstrap, you often need to add a Help button somewhere. When you click or hover your mouse over it, you will be prompted for help information. However, the methods provided by bt do not seem to be available, if any of you know about bootstrap, you can leave a message. The younger brother has learned:The Code is as follows:

The previous buttons must be defined as pop;

$ (Function () {$ (". pop "). popover ({placement: 'right', trigger: 'manual', delay: {show: 10, hide: 10}, html: true, title: function () {return $ ("# data-original-title" ).html () ;}, content: function () {return $ ("# data-content" ).html (); // convert content to html}); $ ('body '). click (function (event) {var target = condition (event.tar get); // you can determine the content you are currently clicking if (! Target. hasClass ('pover ')&&! Target. hasClass ('pop ')&&! Target. hasClass ('pover-content ')&&! Target. hasClass ('pover-title ')&&! Target. hasClass ('arrow') {$ ('. pop '). popover ('hide '); // when you click the content related to the non-pop-up box of the body, close all popovers}); $ (". pop "). click (function (event) {$ ('. pop '). popover ('hide '); // when you click a button, close all other content first. $ (This). popover ('toggle '); // then open it only. });});

-------- The code is not original. Learn from the online experts and learn the record by yourself. Do not spray it!

In the above BootStrap custom popover, the implementation of the click area hiding function is all the content shared by the editor. I hope to give you a reference, and I hope you can also support the help house.

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.