小编Hir*_*iya的帖子

克隆元素与克隆(true)单击无法正常工作

我正在应用克隆方法克隆元素并将其作为我的要求附加.一切正常,但我无法点击克隆元素.我试图找到解决方案,但我没有得到它,请指导我解决问题检查我的附加代码

$('.circle').click(function() {
  if ($(this).closest("li").children("ol").length) {
    debugger;
    var clonediv = $(this).closest('li');
    var clndiv = $(this).parentsUntil('li').siblings('ol').children('li:eq(0)');
    var newdiv = clonediv.clone(true, true);
    newdiv.html('<div>' + clonediv.find('div').eq(0).html() + '</div>');
    newdiv.find('.circle').removeClass('circle').addClass('close');
    newdiv.insertAfter(clndiv);
  } else {
    var clonediv = $(this).parentsUntil('li');
    var clndiv = $(this).closest('ol');
    var newdiv = clndiv.clone(true, true);
    newdiv.html('<li><div>' + clonediv.html() + '</div></li>');
    newdiv.find('.circle').removeClass('circle').addClass('close');
    newdiv.insertAfter(clonediv);
  }
});
$('.close').on('click', function() {
  $(this).closest('li').remove();
  console.log('remove');
});
$('li div :header').each(function(index) {
  $("li div :header").get(index).contentEditable = "true";
});
Run Code Online (Sandbox Code Playgroud)
*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body …
Run Code Online (Sandbox Code Playgroud)

html css jquery css3

6
推荐指数
1
解决办法
118
查看次数

如何使用 html 和 css 创建中间带有徽标的菜单


我正在尝试创建一个中间带有徽标的导航栏,导航栏项目彼此之间的距离相同。像这样:

在此处输入图片说明

但是,我在使导航栏响应时遇到问题。正如您从屏幕截图中看到的,徽标和链接之间的距离不相等。 在此处输入图片说明

 header {
  width: 100%; 
  margin: 0 auto;
}

#logo {
    text-align: center;
}

.nav {
    text-align: center;
}

.nav li {
  display: inline;
  margin-left: 7em;
  margin-right: 7em;
}

/* use media query to change the layout */
@media  (min-width: 768px) {
    body {
        background-color: #f2f2f2;
    }

    .nav {
        margin-top: -42px;
    }

    .nav li:nth-child(1), .nav li:nth-child(2) {
        float: none;
    }

    .nav li:nth-child(3), .nav li:nth-child(4) {
        float: none;
    }
}

.container {
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto; …
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
1544
查看次数

标签 统计

css ×2

html ×2

css3 ×1

jquery ×1