是否可以将div .timedistance放在.draggable div的左边框上,以便它看起来像这样?
演示:http://jsbin.com/erofot/189
代码:
$('.draggable').hover(function(){
$(this).find('.line').show();
$(this).find('.timedistance').show();
}, function() {
$(this).find('.line').hide();
$(this).find('.timedistance').hide();
});
}
});
$(".draggable").each(function() {
$(this).append("<div class='line'></div>");
$(this).append("<div class='timedistance'></div>");
});
和CSS:
.line
{
display: none;
width:5px; height:200px; background:#ccc;
}
.timedistance
{
display: none;
width:100px;
height:54px;
background:#ccc;
}
答案 0 :(得分:0)
解决方案是:
margin-left: -100px;
margin-top: -54px;