【发布时间】:2013-08-05 14:16:40
【问题描述】:
是否可以将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;
}
【问题讨论】:
-
很难将上面的图片与您链接到的示例联系起来。
-
您是否可以将您的标记也包含在内,或者可能将所有代码都包含在 jsfiddle 中,在那里可以查看实际问题。
标签: javascript jquery html css show-hide