Page 196 - Computer Software Application TP - Volume 1
P. 196
COMPUTER SOFTWARE APPLICATION - CITS
2 Positioning Popovers
• Open the text editor
• Write the following codes
<html lang=”en”>
<head>
<title>Bootstrap Example</title>
<meta charset=”utf-8”>
<meta name=”viewport” content=”width=device-width, initial-scale=1”>
<link href=https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css rel=”stylesheet”>
<script src=”https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js”>
</script>
</head>
<body>
<div class=”container mt-5”>
<h3>Popover Positioning</h3>
<p>Click on the links to see the popover in action:</p>
<p>popover on top and bottom</p>
<br/><br/><br/><br/>
<a href=”#” title=”Header” data-bs-toggle=”popover” data-bs-placement=”top”
data-bs-content=”Content”>Top</a>
<a href=”#” title=”Header” data-bs-toggle=”popover” data-bs-placement=”bottom”
data-bs-content=”Content”>Bottom</a>
</div>
<br/><br/><br/>
<div class=”container mt-5”>
<h3>Popover Positioning</h3>
<p>Click on the links to see the popover in action:</p>
<p>popover on left and right side </p>
<a href=”#” title=”Header” data-bs-toggle=”popover” data-bs-placement=”left”
data-bs-content=”Content”>Left</a>
<a href=”#” title=”Header” data-bs-toggle=”popover” data-bs-placement=”right”
data-bs-content=”Content”>Right</a>
</div>
<script>
var popoverTriggerList = [].slice.call(document.querySelectorAll(‘[data-bs-toggle=”popover”]’))
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
})
</script>
</body>
</html>
• Save the program as a .html file
• Open the html file with a web browser
• Verify the output.
181
CITS : IT & ITES - Computer Software Application - Exercise 47