Minimizing the chat window

时间:2017-10-03 09:01:10

标签: javascript

Here i have code for closing the window.

    var textClose = document.createElement("span");
    textClose.setAttribute("class", "windowClose");
    textClose.innerHTML = "[X]";
    this.addOnClickListener(textClose, this.hide, this);

here i am writing code for minimize but not working.

    var textMin = document.createElement("span");
    textMin.setAttribute("class", "windowMin");
    textMin.innerHTML = "[-]";
    this.addOnClickListener(textMin, this.slideToggle, this);

1 个答案:

答案 0 :(得分:0)



	var textClose = document.createElement("SPAN");
    var t = document.createTextNode("[X]");
    textClose.className = "windowClose"
    textClose.appendChild(t);
    document.body.appendChild(textClose);
    textClose.addEventListener("click",  function openWin() {
    window.close ();
    
});
  var textMin = document.createElement("SPAN");
var t1 = document.createTextNode("[-]");
    textMin.className = "windowMin";
    textMin.appendChild(t1);
    document.body.appendChild(textMin);
    textMin.addEventListener("click",  function minWin() {
    /*window.resizeTo(0,0);
//window.moveTo(0,screen.height-50);*/
//Close window Working in IE
//OR
window.resizeTo(250, 250);
window.focus();
});
    
  

.windowClose{
color:#FF0000;
cursor:pointer
}
.windowMin{
color:#00FF00;
cursor:pointer
}