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.