How to display unlimited items horizontally?

iori

I have a list of items in one of my view. I can only fit up to 6 items, and it's laid out like this:

enter image description here

I used class="col-md-2" for each one.


When I have more than 6, it just simply go down to the another row. I don’t want that. You can see it here.

enter image description here


Now, if the list has 6 or more items,

  • list them horizontally
  • show the big > so that the users will know that there is more
  • show the 2 dots in the middle

enter image description here

Edit This is what I got so far. I used Larval 4 so this syntax is in HTML/Blade.

@foreach ( MarketingMaterialCategory::all() as $mmc )

    <h2><i class="fa fa-file-image-o color lighter"></i>&nbsp; {{{ $mmc->name or '' }}} &nbsp;<small> </small></h2>

    <div class="row">

    @foreach ( MarketingMaterial::where('marketing_materials_category_id','=', $mmc->id )->get() as $marketing_material)

    <div class="col-md-2" >
        <!-- Shopping items -->
        <div class="shopping-item">
            <!-- Image -->
            <div class="col-sm-12 imgbox" >
                <!-- <span class="col-sm-6"></span> -->
                <a href="#"><img class="col-sm-12 pull-right" width="200" src="/marketing_materials/{{$marketing_material->id}}/download/thumb_path" alt="" /></a>
            </div>

            <!-- Shopping item name / Heading -->
            <h6><a href="#">{{{ $marketing_material->title or '' }}}</a><span class="color pull-right">{{ FileHelper::formatBytes($marketing_material->media_size,0) }}</span></h6>

            <!-- Shopping item hover block & link -->
            <div class="item-hover bg-color hidden-xs">
                <a href="#">Download</a>
            </div>
        </div>
    </div>

    @endforeach

    </div>
    <hr>

@endforeach

Can someone help me how to resolve this ?

Harrison

Bootstrap doesn't support that kind of scrolling. However, I have used this JavaScript library in the past and it does pretty much exactly what you want: Slick.js

It is very flexible and it will only show the scrolling options if it can't display all the contents on the page.

If you use it though, do not use the bootstrap col-md-2 classes, just set a manual width.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to center RecyclerView items horizontally with vertical GridLayoutManager

How to display "divs" horizontally?

How to display sub menu horizontally?

How to display hr horizontally with flex?

How can I display items in a ListView horizontally in Xamarin.forms xaml?

How to arrange items horizontally in vertical layout?

Laravel 5.6 | Display list items horizontally, not vertically

How to display time series forecasted values horizontally?

css: how to display a radiobuttonlist horizontally?

How do I display list of items horizontally on a list View, using WPF?

How to display stacked bar chart horizontally?

How to center multiple buttons horizontally to the display size?

How to display 6 items in 2 rows horizontally equidistant in Android

How to display bound data horizontally in ListBox

How to position List items horizontally in winforms

How to horizontally flip display?

How to create a combobox with items displayed horizontally?

How to display my values in props array horizontally

How to center horizontally items in recyclerview that uses gridlayoutmanager

How do I display my Bootstrap nav items under my title horizontally in mobile view?

How do i align text horizontally between 2 other items in display:flex construction?

How can i display li elements horizontally

How to display one <ul> list into unlimited columns?

How to display List<int> in DataTable horizontally?

How to display List<int> in DataGrid horizontally?

How to display cards horizontally with for loop in Flask

How to display image horizontally in block div?

How to horizontally center body items without <center>

display list items horizontally