How to do a read more? [duplicate]

-2

I have a text that I am loading from the database, but it is very long so I was thinking about doing an effect in JavaScript to read more, (or less). I hunted for information about it but they show it with two < div > and it's not exactly what I need. I hope you can help me

    
asked by Jessy Domfer 10.12.2018 в 02:32
source

1 answer

0

If it helps, I'll give you an example of how you could do it with Bootstrap (Jquery already implied)

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>

<div class="container">
  <button type="button" class="btn btn-primary mt-5" data-toggle="collapse" data-target="#demo">Leer mas</button>
  <div id="demo" class="collapse">
    Lorem ipsum dolor sit amet, consectetur adipisicing elit,
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
  </div>
</div>
    
answered by 10.12.2018 в 02:46