I am currently working on implementing a bootstrap setup that includes a small text preview and an expandable panel for overflowing text. The issue is that the setup was designed for Bootstrap 3, but I need it to work with Bootstrap 4 in my project using cards. When I tried to implement it, it didn't function as expected even when using Bootstrap 3 CDNs (
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
and <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
). It simply displayed the title 'Bacon Ipsum' without any functionality.
I'm not very proficient in HTML, JS, CSS, and CDNs, so I might have made some mistakes. If there are issues with the CSS or JavaScript CDN that I'm using, please point them out. The only modification I made was changing the div id to a class. Although I've achieved similar functionalities with accordion classes before, I haven't been able to replicate this specific setup with a preview and a single expandable section for text.
In my index.html file (with style.css loaded last and JavaScript CDNs at the bottom of the body), here's what the code looks like:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<div class="module">
<h3>Bacon Ipsum</h3>
<p class="collapse" id="collapseExample" aria-expanded="false">
Bacon ipsum dolor amet doner picanha tri-tip biltong leberkas salami meatball tongue filet mignon
landjaeger tail. Kielbasa salami tenderloin picanha spare ribs, beef ribs strip steak jerky cow. Pork
chop chicken ham hock beef ribs turkey jerky. Shoulder beef capicola doner, tongue tail sausage short
ribs andouille. Rump frankfurter landjaeger t-bone, kielbasa doner ham hock shankle venison. Cupim
capicola kielbasa t-bone, ball tip chicken andouille venison pork chop doner bacon beef ribs kevin
shankle. Short loin leberkas tenderloin ground round shank, brisket strip steak ham hock ham.
</p>
<a role="button" class="collapsed" data-toggle="collapse" href="#collapseExample"
aria-expanded="false" aria-controls="collapseExample"></a>
</div>
</div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="http://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</body>
</html>
Additionally, if it's possible to combine this setup with another one that adds ellipses to the overflow text within a card (as seen in this example), that would be ideal!
UPDATE
In the updated index.html file:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="container">
<div class="module">
<h3>Bacon Ipsum</h3>
<p class="collapse" id="collapseExample" aria-expanded="false">
Bacon ipsum dolor amet doner picanha tri-tip biltong leberkas salami meatball tongue filet mignon
landjaeger tail. Kielbasa salami tenderloin picanha spare ribs, beef ribs strip steak jerky cow. Pork
chop chicken ham hock beef ribs turkey jerky. Shoulder beef capicola doner, tongue tail sausage short
ribs andouille. Rump frankfurter landjaeger t-bone, kielbasa doner ham hock shankle venison. Cupim
capicola kielbasa t-bone, ball tip chicken andouille venison pork chop doner bacon beef ribs kevin
shankle. Short loin leberkas tenderloin ground round shank, brisket strip steak ham hock ham.
</p>
<a role="button" class="collapsed" data-toggle="collapse" href="#collapseExample"
aria-expanded="false" aria-controls="collapseExample"></a>
</div>
</div>
</body>
</html>
The content in style.css has been directly copied from a jfiddle example. The HTML structure is contained within actual HTML tags, and although there isn't a card used in this case, the collapsible panel will eventually be incorporated into a card component.
The current output appears as shown in the image below:
https://i.sstatic.net/Nu4UV.png
I can see the collapsed text in the source, but it's not visible on the page. Please inform me if there is additional diagnostic information needed to resolve this issue. This setup will ultimately be rendered through a Django template.