JavaScript Bootstrap dropdown menu with image and long text bootstrap dropdown menu not working,bootstrap dropdown menu on hover,

I am trying to create a dropdown menu with Bootstrap, with images and a long text, that may have to be word-wrapped to be inside a width of 500px

I tried suggestions like this:

.dropdown-menu {
    width: 500px;
    white-space: normal;
}

Here is my fiddle: http://jsfiddle.net/azu0zwrr/

Any ideas?

Answer:1

Try to add :

overflow: hidden;

.dropdown-menu li{
  width: 500px; white-space: normal;overflow: hidden;
}
.img-thumbnail {
  width:75px;height:75px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-dropdown.js"></script>
<link target='_blank' href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet"/>

<div class="btn-group"><button aria-expanded="true" data-toggle="dropdown" class="btn btn-primary btn-lg dropdown-toggle" type="button">Selecione um produto&nbsp;&nbsp;&nbsp;<b class="caret"></b></button><ul class="dropdown-menu"><li><a><img class="img-thumbnail hidden-xs" src="http://www.extra-imagens.com.br/Control/ArquivoExibir.aspx?IdArquivo=107393037">&nbsp;&nbsp;Tablet Multilaser ML Supra Quad Core com Tela 7”, 8GB, Wi-Fi, Android 4.4, Suporte à Modem 3G e Processador Quad Core - Rosa</a></li><li><a><img class="img-thumbnail hidden-xs" src="http://www.extra-imagens.com.br/Control/ArquivoExibir.aspx?IdArquivo=107392987">&nbsp;&nbsp;Tablet Multilaser ML Supra Quad Core com Tela 7”, 8GB, Wi-Fi, Android 4.4, Suporte à Modem 3G e Processador Quad Core - Branco</a></li></ul></div>
Answer:2

Add this to your css:

.dropdown-menu li a {
word-wrap: break-word;
white-space: normal;
}

fiddle: https://jsfiddle.net/1usvrs3e/

Answer:3
 Check this out This should be working for you 

     <li ><a><p style="word-wrap: break-word;" ><img class="img-thumbnail hidden-xs" src="http://www.extra-imagens.com.br/Control/ArquivoExibir.aspx?IdArquivo=107393037">&nbsp;&nbsp;Tablet Multilaser ML Supra Quad Core com Tela 7”, 8GB, Wi-Fi, Android 4.4, Suporte à Modem 3G e Processador Quad Core - RosaaSdad</a></p></li>
Answer:4

Hello say i have an array of objects that looks like this let myArray = [ {item1: true}, {item2: false}, {item3: true}, {item4: false} ] How would I iterate though this to return a new array ...

Hello say i have an array of objects that looks like this let myArray = [ {item1: true}, {item2: false}, {item3: true}, {item4: false} ] How would I iterate though this to return a new array ...

I have a problem. I just started learning jQuery, my first experience with javascript at all. And I want to make an element animate on click, and I did make that work: HTML: <h1>Testing</h1&...

I have a problem. I just started learning jQuery, my first experience with javascript at all. And I want to make an element animate on click, and I did make that work: HTML: <h1>Testing</h1&...

  1. jquery multiple click events
  2. jquery multiple click handlers
  3. jquery multiple click selectors
  4. jquery multiple click events same function
  5. jquery multiple click
  6. jquery multiple click events firing
  7. jquery multiple click functions
  8. jquery multiple click events order
  9. jquery multiple click listeners
  10. jquery multiple click handlers order
  11. jquery multiple click classes
  12. jquery click multiple elements
  13. jquery click multiple times
  14. jquery click multiple elements same class
  15. jquery click multiple buttons
  16. jquery click multiple id
  17. jquery click multiple elements same id
  18. jquery click multiple div
  19. jquery click multiple parameters
  20. jquery click multiple arguments

const map = {} for (let i=0;i<10**5;i++) { map[i] = true } let ans = 0 for (let i in map) { for (let j in map) { ans += i+j } } console.log(ans) The above code when run ...

const map = {} for (let i=0;i<10**5;i++) { map[i] = true } let ans = 0 for (let i in map) { for (let j in map) { ans += i+j } } console.log(ans) The above code when run ...

  1. javascript heap memory error
  2. javascript heap memory increase
  3. javascript heap memory limit
  4. javascript heap memory
  5. js heap memory
  6. js heap memory leak
  7. javascript memory heap stack
  8. javascript memory heap code
  9. clear javascript heap memory
  10. javascript heap out memory
  11. javascript memory heap size
  12. javascript heap out of memory
  13. firefox javascript heap memory disclosure vulnerability
  14. node js heap memory usage
  15. node js heap memory
  16. javascript heap out of memory npm
  17. javascript heap out of memory webpack
  18. javascript heap out of memory node
  19. javascript heap out of memory npm build
  20. javascript heap out of memory angular 7

I'm using RSpec + capybara, and the capybara-webkit as driver. I have to check if a JS box exists in the page after clicking on a button, but with no results. If I use selenium as a driver, the test ...

I'm using RSpec + capybara, and the capybara-webkit as driver. I have to check if a JS box exists in the page after clicking on a button, but with no results. If I use selenium as a driver, the test ...

  1. check exists in sql
  2. check file exists with javascript
  3. check if file exists with python
  4. check if file exists with wildcard bash
  5. check if file exists with powershell
  6. check if element exists with jquery
  7. check if file exists with curl
  8. check if file exists with javascript
  9. check if file exists with bash
  10. check if service exists with ansible
  11. check if file exists with ifstream
  12. check if class exists with jquery
  13. check if file exists with vba
  14. check if file exists with wget
  15. check if file exists with php
  16. check if row exists with mysql
  17. check if user exists with ansible
  18. check if directory exists with powershell
  19. check if folder exists with powershell