我正在尝试修改我的布局,只是为了将link_to添加到我的下拉列表中.
以前的代码:
%li.divider
%li
%a{:href => "#"}
%i.fa.fa-user-profile
Add new user
Run Code Online (Sandbox Code Playgroud)
我这样编辑:
%li.divider
%li
= link_to '<i class="fa fa-user-profile"></i> Add new user'.html_safe, new_user_path
Run Code Online (Sandbox Code Playgroud)
一切看起来都很好,但fa-user-profile是0px x 0px,它是不可见的.我做错了什么?
Html输出:
这是我的脚本:
<script>
$(function() {
t1 = window.performance.now()
var $sortable1 = $( "#dragableElement" ).sortable({
connectWith: ".connectedSortable",
items: ".sorting-initialize",
containment: "window"
});
$sortable1.find(".ui-state-default").one("mouseenter",function(){
$(this).addClass("sorting-initialize");
$sortable1.sortable('refresh');
});
t2 = window.performance.now()
console.log(t2-t1)
});
</script>
Run Code Online (Sandbox Code Playgroud)
是否可以在此脚本中更改拖动项目的样式?例如添加背景:'黄色',它会改变颜色等?