The jquery input box is used to search for the example code of the keyword and highlight the color.
The instance code is as follows:
<Div> <a class = "btn-success show" title = "Popover title" data-container = "body" data-toggle = "popover" data-placement = "bottom "data-content =" some content in Popover at the bottom "> aaaa </a> </div> <script >$ (function () {initPopover () ;}) function initPopover () {$ (". show "). popover ({container: "body", trigger: "manual" // manually triggered }). on ('Show. bs. popover ', function () {$ (this ). addClass ("popover_open ");}). on ('hide. bs. popover ', function () {$ (this ). removeClass ("popover_open") ;}); $ (". show "). click (function () {if ($ (this ). hasClass ("popover_open") {$ (this ). popover ("hide")} else {$ (". popover_open "). popover ("hide"); $ (this ). popover ("show");} var e = arguments. callee. caller. arguments [0] | event; e. stopPropagation () ;}); $ (document ). click (function () {$ (". show "). popover ("hide") ;}}</script>
Note:
1. Not applicable to buttons, a, img, etc.
2. show. bs. popover: this event is triggered immediately when the show instance method is called.
Shown. bs. popover: this event is triggered when the pop-up dialog box is complete (it will wait until the CSS transition effect is complete ).
Hide. bs. popover: this event is triggered immediately when the hide instance method is called.
Hidden. bs. popover: this event is triggered when the tooltip is completely hidden (it will wait until the CSS transition effect is completed ).
3. Introduce jquery and bootstrap header files
4. Cancel bubbling
The above jquery input box searches for keywords and brightens the color of the Instance code is all the content shared to you by xiaobian. I hope you can give us a reference, and hope you can also support the help house.