javascript - How to make a list of images responsive to window size - CSS/JS/Bootstrap -


so have code:

<ul class="acc-list list-inline">     <li>         <img src="image.png" alt="">         <div class="item-container">             <p class="description">texttexttext</p>             <p class="name">texttexttext</p>         </div>     </li>     <li>         <img src="image.png" alt="">         <div class="item-container">             <p class="description">texttexttext</p>             <p class="name">texttexttext</p>         </div>     </li>     <li>         <img src="image.png" alt="">         <div class="item-container">             <p class="description">texttexttext</p>             <p class="name">texttexttext</p>         </div>     </li> </ul> 

with bootstrap , additional css, code producing list of 3 images horizontally across page. images nothing special , i'm using bootstrap reposition when resizing window slightly. if resize window represent similar mobile phone screen example, because of styling , bootstrap list simple shows 3 images on top of each other vertically.

great may think, want in scenario use sort of jquery slider gallery instead. instead of images lining vertically on top of each other in smartphone size window, them go away , come slider gallery.

i have tried, admittedly suck @ jquery/js, i'm wandering if can point me towards example of or can coding. i've looked around on internet seem come across examples of slider resizing window.

however, want rid of list code , throw these images entirely new slider gallery when window small.

may offer different approach. using simple horizontal scroll - can find nice customizable scrollbars out there make little more fancy. since includes images, didn't jsfiddle:

<!doctype html> <html>  <head>       <style>         body         {             width:100%;         }          #hold         {             width:90%;             height:300px;             overflow-x:auto;             overflow-y:hidden;         }          #image_container         {             width:920px;        /* equal total width of images */             min-width:480px;    /* minimum device size */         }          #image_container li         {             display:inline;             width:300px;             height:100%;             margin:2px;         }          #image_container li img         {             width:300px;         }      </style>  </head> <body>      <div id="hold">         <ul id="image_container">             <li><img src="../images/slides/bridge.jpg"></li>             <li><img src="../images/slides/road.jpg"></li>             <li><img src="../images/slides/leaf.jpg"></li>         </ul>     </div>  </body>  </html> 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -