Html 可排序控制柄,将动画始终向左拖动
我正在尝试将拖动动画的偏移从控制柄向右翻转,而不是向左翻转。每当我想要拖动它时,当控制柄位于右侧时,动画将自动从左侧开始。我想从右边开始Html 可排序控制柄,将动画始终向左拖动,html,list,jquery-ui-sortable,drag,Html,List,Jquery Ui Sortable,Drag,我正在尝试将拖动动画的偏移从控制柄向右翻转,而不是向左翻转。每当我想要拖动它时,当控制柄位于右侧时,动画将自动从左侧开始。我想从右边开始 <ol class='leerrails_list'> <li> <a href="leertraject.asp?dlt_id=<%=lt3_id%>"> <div class = "leer
<ol class='leerrails_list'>
<li>
<a href="leertraject.asp?dlt_id=<%=lt3_id%>">
<div class = "leerrails_list_img"
style="background-image:url('/_domains/bz_bluelearning_nl/images/aanbod/feedback en Fu_up@2x.png');" ></div>
<p>Feedback</p>
<span class = "label2" >Managementrol</span>
<div class = "leerrails_list_voortgang_blok">
<div class = "leerrails_list_voortgang" style = "width:64px;"></div>
</div>
</a>
<i class="fas fa-sort"></i>
</li>
<li>
<a href="https://bz.bluelearning.nl/leerplein/olo_inschrijven_bz.asp?lt_id=31">
<div class = "leerrails_list_img"
style="background-image:url('/_domains/bz_bluelearning_nl/images/aanbod/Beinvloeden van systemen@2x.png');"></div>
<p>Beïnvloeden in het systeem</p>
<span class = "label2" >Managementrol</span>
<div class = "leerrails_list_voortgang_blok">
<div class = "leerrails_list_voortgang" style = "width:64px;"></div>
</div>
</a>
<i class="fas fa-sort"></i>
</li>
<li>
<a href="https://bz.bluelearning.nl/leerplein/olo_inschrijven_bz.asp?lt_id=38">
<div class = "leerrails_list_img"
style="background-image:url('/_domains/bz_bluelearning_nl/images/aanbod/Sturen_adviseren in een politiek bestuurlijke omgeving@2x.png');"></div>
<p>Adviseren in een politiek-bestuurlijke omgeving</p>
<span class = "label2" >Managementrol</span>
<div class = "leerrails_list_voortgang_blok">
<div class = "leerrails_list_voortgang" style = "width:64px;"></div>
</div>
</a>
<i class="fas fa-sort"></i>
</li>
<li>
<a href="https://bz.bluelearning.nl/leerplein/olo_inschrijven_bz.asp?lt_id=21">
<div class = "leerrails_list_img"
style="background-image:url('/_domains/bz_bluelearning_nl/images/aanbod/love module@2x.png');"></div>
<p>LOVE Module</p>
<span class = "label1" >Persoonlijk leiderschap</span>
<div class = "leerrails_list_voortgang_blok">
<div class = "leerrails_list_voortgang" style = "width:64px;"></div>
</div>
</a>
<i class="fas fa-sort"></i>
</li>
<!--inactieve li -->
<li class = "leerroute_item_inactief">
<i class="fas fa-sort" style= "display:none;"></i>
<div class = "leerrails_list_img"></div>
<div class = "leerrails_list_inactief"></div>
<p>Hier komt uw e-module</p>
</li>
</ol>
<script>
$(function () {
$("ol.leerrails_list").sortable();
});
$("ol.leerrails_list").sortable({
group: 'no-drop',
handle: 'i.fa-sort',
onDragStart: function ($item, container, _super) {
// Duplicate items of the no drop area
if(!container.options.drop)
$item.clone().insertAfter($item);
_super($item, container);
}
});
</script>
<style>
.leerroute_overige {
position: relative;
}
@media (max-width:1060px){
.leerroute_overige {
position: relative;
-webkit-margin-before: 10px;
-webkit-margin-after: 40px;
margin-bottom: 20px;
width: 100%;
left: 30px;
margin-top: 0px;
}
}
ol.leerrails_list .leerrails_list_img::before{
content: '';
position: relative;
height: 10px;
width: 10px;
background-color: rgb(255, 255, 255);
border: 1px solid red;
border-radius: 50%;
display: inline-flex;
left: -38px;
margin-right: -15px;
top: 30%;
}
ol.leerrails_list li.leerroute_item_inactief .leerrails_list_img::before{
content: '';
position: relative;
height: 10px;
width: 10px;
background-color: rgb(255, 255, 255);
border: 1px solid red;
border-radius: 50%;
display: inline-flex;
left: -38px;
margin-right: -15px;
top: 30%;
}
ol.leerrails_list .leerroute_actief {
content: '';
position: relative;
height: 10px;
width: 10px;
background-color: rgb(255, 0, 0);
border: 1px solid red;
border-radius: 50%;
display: inline-flex;
left: -46px;
margin-right: -15px;
top: 30%;
}
ol.leerrails_list .leerrails_list_img::before:hover {
content: '';
position: relative;
height: 10px;
width: 10px;
background-color: rgb(255, 0, 0);
border: 1px solid red;
border-radius: 50%;
display: inline-flex;
left: -46px;
margin-right: -15px;
top: 30%;
}
ol.leerrails_list .leerrails_list_img::before:first-of-type {
content: '';
position: relative;
height: 10px;
width: 10px;
background-color: rgb(255, 0, 0);
border: 1px solid red;
border-radius: 50%;
display: inline-flex;
left: -46px;
margin-right: -15px;
top: 30%;
}
ol.leerrails_list .leerrails_list_img::before:visited {
content: '';
position: relative;
height: 10px;
width: 10px;
background-color: rgb(255, 0, 0);
border: 1px solid red;
border-radius: 50%;
display: inline-flex;
left: -46px;
margin-right: -15px;
top: 30%;
}
ol.leerrails_list .leerrails_list_img::before:active {
content: '';
position: relative;
height: 10px;
width: 10px;
background-color: rgb(255, 0, 0);
border: 1px solid red;
border-radius: 50%;
display: inline-flex;
left: -46px;
margin-right: -15px;
top: 30%;
}
ol.leerrails_list {
list-style-type: none;
counter-reset: my-counter;
}
ol.leerrails_list a {
color: black;
text-decoration: none;
}
ol.leerrails_list::before{
content: '';
position: absolute;
border-left: 4px dotted #8f8f8f;
left: -24px;
bottom: 0;
top: 0;
transform: translate3d(31px, 0, 0);
}
ol.leerrails_list .leerrails_list_img{
position: relative;
z-index: 3;
height:88px;
width: 100px;
float: left;
cursor: pointer;
background-size: cover;
background-position-x: center;
opacity: 1;
background-repeat: no-repeat;
}
ol.leerrails_list li p {
position: relative;
top: 10px;
left: 20px;
text-align: left;
}
ol.leerrails_list span.label1 {
position: relative;
top: 0px;
left: 20px;
text-align: left;
font-size: 11px;
background: #037912;
color: white;
padding: 5px;
border-radius: 3px;
}
ol.leerrails_list span.label2 {
position: relative;
top: 0px;
left: 20px;
text-align: left;
font-size: 11px;
background: #008DC2;
color: white;
padding: 5px;
border-radius: 3px;
}
/*
ol.leerrails_list a {
position: relative;
margin: 20px 30px;
color: white;
top: 30%;
}
*/
ol.leerrails_list a:hover{
background-size: 100px 100px;
transition: .1s ease-in-out;
position: relative;
margin: 20px 0px;
color: black;
}
ol.leerrails_list li.placeholder {
position: relative;
/** More li styles **/
}
ol.leerrails_list li.placeholder:before {
position: absolute;
/** Define arrowhead **/
}
ol.leerrails_list li::before{
content: counter(my-counter);
background: transparent;
font-size: 25px;
width: 2rem;
height: 2rem;
border-radius: 50%;
display:block;
line-height: 5.8rem;
color: #7e7e7e;
text-align: left;
margin-right: 20rem;
position: absolute;
float: left;
margin-left: -60px;
}
/*
ol.leerrails_list li.leerroute_item_inactief::before{
content: counter(my-counter);
background: transparent;
width: 2rem;
height: 2rem;
border-radius: 50%;
display:block;
line-height: 5.8rem;
color: rgb(136, 136, 136);
text-align: left;
margin-right: 20rem;
position: absolute;
left: -60px;
}
*/
ol.leerrails_list li {
counter-increment: my-counter;
font-family: 'Lato';
height: 88px;
width: 470px;
background: white;
margin-bottom: 10px;
box-shadow: 0px 2px 2px 2px #00000040;
cursor: pointer;
}
ol.leerrails_list li.leerroute_item_inactief {
counter-increment: my-counter;
font-family: 'Lato';
height: 88px;
width: 470px;
background: rgba(255, 255, 255, 0);
border: 1px solid grey;
margin-bottom: 10px;
cursor: pointer;
position: relative;
box-shadow: none;
}
ol.leerrails_list li.leerroute_item_inactief:hover{
box-shadow: none;
}
@media (max-width:1060px){
ol.leerrails_list li.leerroute_item_inactief {
width: 90%;
}
}
ol.leerrails_list li.leerroute_item_inactief p{
margin: 17px 60px;
/* text-align: center; */
padding: 5px;
color: grey;
font-weight: 300;
}
/*
ol.leerrails_list li i.fas {
position: absolute;
left: 100%;
}
*/
ol.leerrails_list li i.fa-sort {
font-size: 19px;
position: relative;
color: gray;
border: none;
padding: 8px;
z-index: 100;
float: right;
top: -64px;
}
ol.leerrails_list li.leerroute_item_inactief i.fa-sort {
font-size: 19px;
position: absolute;
margin-left: 85%;
color: gray;
border: none;
padding: 6px;
z-index: 100;
}
@media (max-width:1060px){
ol.leerrails_list li {
width: 90%;
}
}
ol.leerrails_list li:hover {
z-index: 100;
background: #f8f8f8;
box-shadow: 0px 3px 3px 3px #0000006b;
transition: .1s ease-in-out;
}
ol.leerrails_list .leerrails_list_voortgang{
height: 6px;
background: rgba(0,200,83,1);
top: 0px;
position: relative;
left: 0px;
z-index: 0;
}
@media (max-width:1060px){
ol.leerrails_list .leerrails_list_voortgang {
width: 100%;
position: relative;
max-width: -webkit-fill-available;
}
}
ol.leerrails_list .leerrails_list_voortgang_blok {
width: 370px;
height: 6px;
background: rgb(233, 233, 233);
top: 23px;
position: relative;
left: 0px;
z-index: 0;
margin-left: 100px;
}
@media (max-width:1060px){
ol.leerrails_list .leerrails_list_voortgang_blok {
width: 100%;
position: relative;
max-width: -webkit-fill-available;
max-width: -moz-available;
}
}
ol.leerrails_list .leerrails_list_img .img_1 {
display: block;
content: '';
height: 100px;
width: 100px;
border: 1px solid black;
background-image: url("../images/aanbod/Diversiteit en inclusie.png");
}
</style>
Hier komt uw电子模块
$(函数(){
$(“ol.leerrails_list”).sortable();
});
$(“ol.leerrails_列表”)。可排序({
小组:"不滴",,
句柄:“i.fa-sort”,
onDragStart:function($item,container,_super){
//禁止放置区域的重复项
如果(!container.options.drop)
$item.clone().insertAfter($item);
_超级(物品、容器);
}
});
leerroute_overige先生{
位置:相对位置;
}
@介质(最大宽度:1060px){
leerroute_overige先生{
位置:相对位置;
-之前的webkit保证金:10px;
-网络工具包后的利润率:40px;
边缘底部:20px;
宽度:100%;
左:30px;
边际上限:0px;
}
}
ol.leerrails\U list.leerrails\U list\U img::before{
内容:'';
位置:相对位置;
高度:10px;
宽度:10px;
背景色:rgb(255、255、255);
边框:1px纯红;
边界半径:50%;
显示:内联flex;
左:-38px;
右边距:-15px;
最高:30%;
}
ol.leerrails\U list li.leerroute\U item\U INACTEF.leerrails\U list\U img::before{
内容:'';
位置:相对位置;
高度:10px;
宽度:10px;
背景色:rgb(255、255、255);
边框:1px纯红;
边界半径:50%;
显示:内联flex;
左:-38px;
右边距:-15px;
最高:30%;
}
ol.leerrails\u列表。leerroute\u活动{
内容:'';
位置:相对位置;
高度:10px;
宽度:10px;
背景色:rgb(255,0,0);
边框:1px纯红;
边界半径:50%;
显示:内联flex;
左-46px;
右边距:-15px;
最高:30%;
}
ol.leerrails\u list.leerrails\u list\u img::before:悬停{
内容:'';
位置:相对位置;
高度:10px;
宽度:10px;
背景色:rgb(255,0,0);
边框:1px纯红;
边界半径:50%;
显示:内联flex;
左-46px;
右边距:-15px;
最高:30%;
}
ol.leerrails\u list.leerrails\u list\u img::before:类型的第一个{
内容:'';
位置:相对位置;
高度:10px;
宽度:10px;
背景色:rgb(255,0,0);
边框:1px纯红;
边界半径:50%;
显示:内联flex;
左-46px;
右边距:-15px;
最高:30%;
}
ol.leerrails\U list.leerrails\U list\U img::之前:已访问{
内容:'';
位置:相对位置;
高度:10px;
宽度:10px;
背景色:rgb(255,0,0);
边框:1px纯红;
边界半径:50%;
显示:内联flex;
左-46px;
右边距:-15px;
最高:30%;
}
ol.leerrails\U list.leerrails\U list\U img::before:活动{
内容:'';
位置:相对位置;
高度:10px;
宽度:10px;
背景色:rgb(255,0,0);
边框:1px纯红;
边界半径:50%;
显示:内联flex;
左-46px;
右边距:-15px;
最高:30%;
}
ol.leerrails_列表{
列表样式类型:无;
计数器重置:我的计数器;
}
ol.leerrails_列表a{
颜色:黑色;
文字装饰:无;
}
ol.leerrails_列表::之前{
内容:'';
位置:绝对位置;
左边框:4px点#8f8f;
左:-24px;
底部:0;
排名:0;
转换:translate3d(31px,0,0);
}
ol.leerrails\U列表。leerrails\U列表\U img{
位置:相对位置;
z指数:3;
高度:88px;
宽度:100px;
浮动:左;
光标:指针;
背景尺寸:封面;
背景位置x:中心;
不透明度:1;
背景重复:无重复;
}
L.leerrails_列表李p{
位置:相对位置;
顶部:10px;
左:20px;
文本对齐:左对齐;
}
ol.leerrails_列表span.label1{
位置:相对位置;
顶部:0px;
左:20px;
文本对齐:左对齐;
字体大小:11px;
背景:#037912;
颜色:白色;
填充物:5px;
边界半径:3px;
}
ol.leerrails_列表span.label2{
位置:相对位置;
顶部:0px;
左:20px;
文本对齐:左对齐;
字体大小:11px;
背景:#008DC2;
颜色:白色;
填充物:5px;
边界半径:3px;
}
/*
ol.leerrails_列表a{
位置:相对位置;
利润率:20px 30px;
颜色:白色;
最高:30%;
}
*/
ol.leerrails_列表a:悬停{
背景尺寸:100px 100px;
转换:.1s易入易出;
位置:相对位置;
利润率:20px 0px;
颜色:黑色;
}
ol.leerrails_列表li.placeholder{
位置:相对位置;
/**更多黎族风格**/
}
ol.leerrails\U list li.占位符:之前{
位置:绝对位置;
/**定义箭头**/
}
李:以前{
内容:柜台(我的柜台);
背景:透明;
字体大小:25px;
宽度:2em;
高度:2em;
边界半径:50%;
显示:块;
线高:5.8雷姆;
颜色:#7e7e7e;
文本对齐:左对齐;
保证金权利:20雷姆;
位置:绝对位置;
浮动:左;
左边距:-60px;
}
/*
ol.leerrails\u list li.leerroute\u项目\u不活动::之前{
内容:柜台(我的柜台);
背景:透明;
宽度:2em;
高度:2em;
边界半径:50%;
显示:块;
线高:5.8雷姆;
颜色:rgb(136136136);
文本对齐:左对齐;
保证金权利:20雷姆;
位置:绝对位置;
左:-60px;
}
*/
李先生{
计数器增量:我的计数器;
字体系列:“Lato”;
高度
some code to keep Stack Overflow off my back for sharing a Fiddle, the code in the Fiddle is the original code shared.