【问题标题】:Put div on left border of other div将 div 放在其他 div 的左边框上
【发布时间】: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


【解决方案1】:

解决办法是:

margin-left: -100px;
margin-top: -54px;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-19
    • 2017-07-22
    • 2013-06-20
    • 2013-01-05
    相关资源
    最近更新 更多