我正在使用yui panles我在打开面板时将身体溢出设置为隐藏当面板关闭或点击其关闭链接时如何返回溢出滚动
YUI()。use('yui2-container','yui2-dragdrop','event',function(Y){
var YAHOO = Y.YUI2;
var modal = new YAHOO.widget.Panel("content", {
width: "240px",
fixedcenter: true,
close: true,
draggable: true,
zindex: 4,
modal: true,
visible: false
});
modal.render(document.body);
Y.one('#show').on('click', function() {
document.getElementById("content").style.display = "block";
document.getElementById("content4").style.display = "none";
document.getElementById("content3").style.display = "none";
document.getElementById("content2").style.display = "none";
document.getElementById("content5").style.display = "none";
document.getElementById("reader_body").style.overflow="hidden";
modal.show();
var exit = YAHOO.util.Dom.getElementsByClassName('container-close');
YAHOO.util.Event.addListener(exit, "click", exitFunction);
});
});
答案 0 :(得分:0)
我有一个保存按钮并在其上放置一个调用函数的事件监听器:
var saveButton = YAHOO.util.Dom.get('save_'+id);
YAHOO.util.Event.addListener(saveButton, "click", replaceTxtAction,{'id':someid});
function replaceTxtAction(e,data){
TEXTAREA[data.id].hide();
}
并且我没有在IE8中正确隐藏,所以我只使用了一个addClass('hidden'),其中hidden = display:none;