create popover using jquery is used to display the little content in a tooltip-style popup box . Popovers are also known as advanced tooltips.
You can Use the tooltip when if your content is short if not use popover which increase the efficiency of the content.
Now in this We make Popover Which have these fucntionality as given Below:
- Popover will closed when you click outside any where.
- When you click one popover another popover will closed automatically.
- You can pass link in popover.
- One close sign by which user can close the popover.
Now We will start with coding part:

Popover.html
Popover Using Jquery
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
<!DOCTYPE html> <html> <head> <title>inner outer click</title> {{urvanov-syntax-highlighter-internal:0}} {{urvanov-syntax-highlighter-internal:1}} </head> <body> <div id="B1"><button>Button 1</button><div class="popover pop fade bs-popover-right show" style="display: block;"> <h3 class="popover-header">Developers Guidance <a href="#" class="pophide" id="alert" data-dismiss="alert">×</a></h3> <div class="popover-body"> <p>Popover is closed when you click outside and When you click one popover another popover will closed automatically.You can pass link in popover Also.Popover is designed by Developers Guidance </p> <p> <a href="#" class="btn new float-right"> Read More </a></p> </div> </div> </div> <br><br> <div id="B2"><button>Button 2</button ><div class="popover pop fade bs-popover-right show" style="display: block;"> <h3 class="popover-header">New Popover <a href="#" class="pophide" id="alert" data-dismiss="alert">×</a></h3> <div class="popover-body"> <p>Popover is closed when you click outside and When you click one popover another popover will closed automatically.You can pass link in popover Also.Popover is designed by Developers Guidance </p> <p> <a href="#" class="btn new float-right"> Read More </a></p> </div> </div> </div> <br><br> <div id="B3"><button>Button 3</button><div class="popover pop fade bs-popover-right show" style="display: block;"> <h3 class="popover-header">Developers Guidance <a href="#" class="pophide" id="alert" data-dismiss="alert">×</a></h3> <div class="popover-body"> <p>Popover is closed when you click outside and When you click one popover another popover will closed automatically.You can pass link in popover Also.Popover is designed by Developers Guidance </p> <p> <a href="#" class="btn new float-right"> Read More </a></p> </div> </div> </div> <br><br> <div id="B4"><button>Button 4</button><div class="popover pop fade bs-popover-right show" style="display: block;"> <h3 class="popover-header">New Popover<a href="#" class="pophide" id="alert" data-dismiss="alert">×</a></h3> <div class="popover-body"> <p>Popover is closed when you click outside and When you click one popover another popover will closed automatically.You can pass link in popover Also.Popover is designed by Developers Guidance </p> <p> <a href="#" class="btn new float-right"> Read More </a></p> </div> </div> </div> </div> <br><br> <div id="B5"><button>Button 5</button><div class="popover pop fade bs-popover-right show" style="display: block;"> <h3 class="popover-header">Developers Guidance <a href="#" class="pophide" id="alert" data-dismiss="alert">×</a></h3> <div class="popover-body"> <p>Popover is closed when you click outside and When you click one popover another popover will closed automatically.You can pass link in popover Also.Popover is designed by Developers Guidance </p> <p> <a href="#" class="btn new float-right"> Read More </a></p> </div> </div> </div> <br><br> <div id="show"></div> </body> </html> |
We manage The Custom Popover Using Jquery
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
container = $(".popover"); container.hide(); $('button').click(function() { var parent = $(this).parent().attr('id'); $('#' + parent + ' .popover').show(); }) $(".pophide").click(function(){ $(".pop").hide(); }); $(document).mouseup(function(e) { if (!container.is(e.target) && container.has(e.target).length === 0) { container.hide(); } }); |