This time I will share jQuery Plugin and tutorial about Grid View Switcher For Bootstrap Layout System – grid-view.js, hope it will help you in programming stack.
A tiny grid view switcher for Bootstrap that allows the visitor to quickly switch between Compact View (4×3) and Spaced View (3×3) in your Bootstrap powered grid layout.
How to use it:
1. Load the necessary jQuery library (slim build) and Bootstrap framework in the document.
1 |
< link rel = "stylesheet" href = "/path/to/cdn/bootstrap.min.css" /> |
2 |
< script src = "/path/to/cdn/jquery.slim.min.js" ></ script > |
3 |
< script src = "/path/to/cdn/bootstrap.min.js" ></ script > |
2. Add the class .gv-card
to grid items with the class .col-lg-4
or .col-lg-3
.
002 |
< div class = "gv-card col-4 my-4" > |
005 |
class = "card-img-top project-image" |
006 |
src = "placeholder-image.png" |
007 |
alt = "Some alternate text" |
009 |
< div class = "card-body" > |
010 |
< h3 class = "card-title" >Some title</ h3 > |
011 |
< p class = "card-text" >Some sample text</ p > |
012 |
< a href = "#" class = "btn btn-primary" >Button</ a > |
016 |
< div class = "gv-card col-4 my-4" > |
019 |
class = "card-img-top project-image" |
020 |
src = "placeholder-image.png" |
021 |
alt = "Some alternate text" |
023 |
< div class = "card-body" > |
024 |
< h3 class = "card-title" >Some title</ h3 > |
025 |
< p class = "card-text" >Some sample text</ p > |
026 |
< a href = "#" class = "btn btn-primary" >Button</ a > |
030 |
< div class = "gv-card col-4 my-4" > |
033 |
class = "card-img-top project-image" |
034 |
src = "placeholder-image.png" |
035 |
alt = "Some alternate text" |
037 |
< div class = "card-body" > |
038 |
< h3 class = "card-title" >Some title</ h3 > |
039 |
< p class = "card-text" >Some sample text</ p > |
040 |
< a href = "#" class = "btn btn-primary" >Button</ a > |
044 |
< div class = "gv-card col-4 my-4" > |
047 |
class = "card-img-top project-image" |
048 |
src = "placeholder-image.png" |
049 |
alt = "Some alternate text" |
051 |
< div class = "card-body" > |
052 |
< h3 class = "card-title" >Some title</ h3 > |
053 |
< p class = "card-text" >Some sample text</ p > |
054 |
< a href = "#" class = "btn btn-primary" >Button</ a > |
058 |
< div class = "gv-card col-4 my-4" > |
061 |
class = "card-img-top project-image" |
062 |
src = "placeholder-image.png" |
063 |
alt = "Some alternate text" |
065 |
< div class = "card-body" > |
066 |
< h3 class = "card-title" >Some title</ h3 > |
067 |
< p class = "card-text" >Some sample text</ p > |
068 |
< a href = "#" class = "btn btn-primary" >Button</ a > |