不需要的显示:在课堂上自动添加

时间:2015-09-04 05:12:53

标签: javascript jquery html css panel

我有一个内部有复制链接的面板,当我点击打开我的面板时显示:无自动添加

解决这个问题,我在我的jquery部分添加了这一行:showme.style.display = "none";现在我们可以完美地打开面板但是

之后无法关闭它 有人有解决方案吗?

here是我的链接没有 showme.style.display = "none";


here是我的链接,这是我的代码 WITH showme.style.display = "none";

<!DOCTYPE HTML><!--[if IE 8]><html lang="en" class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--><html lang="en"><!--<![endif]-->
<head><meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script>

<style>

div#panel1 { 
    display: block; 
    background-color:#eee; 
    visibility: hidden;
}

.flip1  { 
    display: block; 
    background-color:#eee;
}

#check  { 
    visibility: hidden; 
    width:12px; height:12px;
}
span#copy-callbacks, span#copy-callbacks2 { 
    float: none; cursor:pointer; 
}
.zclip { 
    border:1px solid red; 
    position:relative; 
    display:inherit; 
}
div#zclip-ZeroClipboardMovie_1.zclip { 
    position: relative; 
    margin-top:-18px; 
}

</style>
<script type="text/javascript">
$(document).ready(function(){
    $("span#copy-callbacks").zclip({
        path:"ZeroClipboard.swf",
        copy:$('#callback-paragraph').text(),
        beforeCopy:function(){
            $('#copy-callbacks').css('display','none');
        },
        afterCopy:function(){
            $('#copy-callbacks').css('display','block');
        }
    });

    document.getElementById("copy-callbacks").onclick = function() {
        document.getElementById("check").style.visibility = "visible";
    }
});


$(document).ready(function() {
    $('span#copy-callbacks').hover(
        function () {
            $(this).css({"color":"#e0ccb4"});
        }, 

        function () {
            $(this).css({"color":"#000"});
        }
    );

    $(".flip1").click(function(){
    $("#panel1").slideToggle("fast");
    });
});

function newwindow() {
    var showme = document.getElementById("panel1");
    showme.style.visibility = "visible";
    showme.style.display = "none";
}
</script>
</head>
<body>

<div style="margin-top:150px;" onclick="newwindow()" class="flip1">Click to slide the first panel down or up</div>
<div style="display: block; padding-bottom:80px;" id="panel1">

<span id="copy-callbacks"> Copy link&nbsp;&nbsp;<img src="check.png" id="check" style="display: inline;"></span>
<span style="font-size:0px;" id="callback-paragraph">essaie sans alert</span>

</div>

<script type="text/javascript" src="jquery.zclip.js"></script>
<script type="text/javascript" src="jquery.cbpFWSlider.min.js"></script>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

  1. 您不需要newwindow()
  2. 对于#panel1:在文档级样式中,删除可见性和显示。
  3. 对于#panel1:采用内联样式,请显示:none
  4. 我说的是第一个链接。