Estoy usando bootstrap 4.3.1 y me gustaría tener un ícono en el que se pueda hacer clic en mi lista de miniaturas para un texto. Tengo una función en la que hago clic en las miniaturas y estas imágenes se muestran en gran tamaño junto a ellas. Ahora quiero tener lo mismo para mi texto.
Aquí está el código:
function myFunction(imgs) { var expandImg = document.getElementById("expandedImg"); var imgText = document.getElementById("imgtext"); expandImg.src = imgs.src; //imgText.innerHTML = imgs.alt; expandImg.parentElement.style.display = "block"; } <!--START Thumbnaill Navbar--> <div style="overflow-y: auto; height: auto; width: 170px;"> <img src="../image" alt="###" class="img-thumbnail border-0 img-thumbnail-desktop" onclick="myFunction(this);"> <!--Here the icon for text --> </div> <!--END Thumbnaill Navbar--> <!--Main Content--> <div class="container expandedImgSize d-flex justify-content-center "> <span onclick="this.parentElement.style.display='none'"></span> <img class="img-fluid" id="expandedImg" src="../PlaceholderImage"> </div>¿Hay una solución elegante para mostrar solo el texto? Haré lo mejor que pueda, pero probablemente necesite ayuda de ustedes (〃 ω〃)
Gracias chicos de antemano!