
Hi Dev,
Today, i we will show you Bootstrap drag and drop using jquery UI sortable. This article will give you simple example of Bootstrap drag and drop using jquery UI sortable. you will learn Bootstrap drag and drop using jquery UI sortable. So let’s follow few step to create example of Bootstrap drag and drop using jquery UI sortable.
Preview:
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | <! DOCTYPE html> < html > < title >Bootstrap Sort list by drag and drop using jquery UI sortable - Codeplaners.com</ title > < meta name = "viewport" content = "width=device-width, initial-scale=1" > < link href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel = "stylesheet" > < script src = "https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js" ></ script > < script > $(function() { $("#sortable").sortable(); $("#sortable").disableSelection(); }); </ script > < body > < div class = "page-content page-container" id = "page-content" > < div class = "container" > < div class = "row" > < div class = "col-sm-12" > < div class = "container-fluid d-flex justify-content-center" > < div class = "list list-row card" id = "sortable" data-sortable-id = "0" aria-dropeffect = "move" > < div class = "list-item" data-id = "13" data-item-sortable-id = "0" draggable = "true" role = "option" aria-grabbed = "false" style = "" > < div >< a href = "#" data-abc = "true" >< span class = "w-40 avatar gd-primary" >C</ span ></ a ></ div > < div class = "flex" > < a href = "#" class = "item-author text-color" data-abc = "true" >Patrick Linod</ a > < div class = "item-except text-muted text-sm h-1x" >For what reason would it be advisable for me to think about business content?</ div > </ div > < div class = "no-wrap" > < div class = "item-date text-muted text-sm d-none d-md-block" >1 weeks ago</ div > </ div > </ div > < div class = "list-item" data-id = "9" data-item-sortable-id = "0" draggable = "true" role = "option" aria-grabbed = "false" > < div >< a href = "#" data-abc = "true" >< span class = "w-40 avatar gd-info" >< img src = "https://codeplaners.com/wp-content/uploads/2020/09/cropped-favicon-social-192x192.png" alt = "." ></ span ></ a ></ div > < div class = "flex" > < a href = "#" class = "item-author text-color" data-abc = "true" >Steven Hmpire</ a > < div class = "item-except text-muted text-sm h-1x" >Build a progressive web app using jQuery</ div > </ div > < div class = "no-wrap" > < div class = "item-date text-muted text-sm d-none d-md-block" >10 days ago</ div > </ div > </ div > < div class = "list-item" data-id = "17" data-item-sortable-id = "0" draggable = "true" role = "option" aria-grabbed = "false" style = "" > < div >< a href = "#" data-abc = "true" >< span class = "w-40 avatar gd-warning" >M</ span ></ a ></ div > < div class = "flex" > < a href = "#" class = "item-author text-color" data-abc = "true" >Alan musk</ a > < div class = "item-except text-muted text-sm h-1x" >it be advisable for me to think about business content?</ div > </ div > < div class = "no-wrap" > < div class = "item-date text-muted text-sm d-none d-md-block" >13/12 18</ div > </ div > </ div > </ div > </ div > </ div > </ div > </ div > </ div > < style > body { background-color: #f9f9fa } .card { background: #faf7f7; border-width: 0; border-radius: .25rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); margin-bottom: 1.5rem; margin: 50px 0 0; position: relative; display: flex; flex-direction: column; min-width: 0; word-wrap: break-word; background-clip: border-box; border: 1px solid rgba(19, 24, 44, .125); border-radius: .25rem } .list-item.block .media { border-bottom-left-radius: 0; border-bottom-right-radius: 0 } .list-item.block .list-content { padding: 1rem } .w-40 { width: 40px !important; height: 40px !important } .avatar { position: relative; line-height: 1; border-radius: 500px; white-space: nowrap; font-weight: 700; border-radius: 100%; display: -ms-flexbox; display: flex; -ms-flex-pack: center; justify-content: center; -ms-flex-align: center; align-items: center; -ms-flex-negative: 0; flex-shrink: 0; border-radius: 500px; box-shadow: 0 5px 10px 0 rgba(50, 50, 50, .15) } .avatar img { border-radius: inherit; width: 100% } .gd-primary { color: #fff; border: none; background: #448bff linear-gradient(45deg, #448bff, #44e9ff) } .flex { -webkit-box-flex: 1; -ms-flex: 1 1 auto; flex: 1 1 auto } .text-color { color: #5e676f } .text-sm { font-size: .825rem } .h-1x { height: 1.25rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical } .no-wrap { white-space: nowrap } .list-row .list-item { -ms-flex-direction: row; flex-direction: row; -ms-flex-align: center; align-items: center; padding: .75rem .625rem } .list-item { position: relative; display: -ms-flexbox; display: flex; -ms-flex-direction: column; flex-direction: column; min-width: 0; word-wrap: break-word } .list-row .list-item>* { padding-left: .625rem; padding-right: .625rem } a:focus, a:hover { text-decoration: none } list-item { background: white } </ style > </ body > </ html > |