【问题标题】:show() a div that's hidden with children() (drag and drop)show() 用 children() 隐藏的 div(拖放)
【发布时间】:2012-09-01 18:29:42
【问题描述】:

这里的第一个问题:)

我正在处理一些拖放 div,我想在拖放到特定 div 时显示隐藏的内容。

这是我的拖放功能:

function drop(ev) {

    ev.preventDefault();

    var data=ev.dataTransfer.getData("Text");
    ev.target.appendChild(document.getElementById(data));

    if($(ev.target).hasClass("items")){

        $(ev.target).children('div').children('.post').hide();
    }
    else if($(ev.target).hasClass("dropzone")) {

        $(ev.target).children('div').children('.post').show();
    }
}

【问题讨论】:

  • $(ev.target).children('div').children('.post').hide();有效,但演出无效
  • 您的问题是什么?什么不工作?
  • 您能否在JS Fiddle 或类似网站上发布SSCCE 现场演示来展示您的问题?有相关的 HTML 吗?
  • 一切正常,直到 "$(ev.target).children('div').children('.post').show();"
  • 你想放弃什么?很抱歉你的问题不太清楚。

标签: javascript jquery drop-down-menu show-hide


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-10
    • 1970-01-01
    相关资源
    最近更新 更多