It works great for closing the window if not needed on the screen anymore.
Now I have been trying really hard to get a minimize/restore function to work with it was well so that when the minimize button is pressed, the second DIV (the content area) collapses and only the 1st DIV (the header area) remains.
Upon pressing 'restore' the 2nd DIV is returned to its original shape and size.
I really need your help in making this happen - please can you kindly take some time to write the functions to minimize / restore the script?
Thanks Aku
2) Angus TurnbullGroup: Moderators Posts: 4235Joined: 7 Dec 2003Location: New ZealandIP: 202.36.--.--
Posted:
I'm glad you like the script!To "minimise", try something like this:
document.getElementById('dwindow').style.clip = 'rect(0 100% 20px 0)';
then to restore set it back to its initial clipping values or just 'auto'. Remember 'clip' is 'rect (top, right, bottom, left)' (although MSIE can have troubles with commas sometimes).
Good luck - Angus.
3) bilgeGroup: Guests IP: 85.101.--.--
Posted:
Hello Angus, I really like your script and want to use it. I want to make the divs that I create draggable and resizable. I am calling the dragresize in the function:
function creatediv(){ counter=counter+1; var div=document.createElement("div"); div["id"]="div_"+counter; document.body.appendChild(div); myStyle=div.style; div.setAttribute("style",myStyle); myStyle.border="thin groove"; myStyle.width="404px" myStyle.height="158px" myStyle.position="absolute" myStyle.left="60" myStyle.top="90" myStyle.background="white";
but I does not even allow me create the div when I use the dragresize. Can you help me how I should use your script because it is just the thing that I want =)
4) Angus TurnbullGroup: Moderators Posts: 4235Joined: 7 Dec 2003Location: New ZealandIP: 203.109.--.--
Posted:
If dragresize has already had apply() called on the document, you don't need to call it again, it'll automatically make all DIVs in the document with the right class names draggable. Try:
div.className = 'drsElement drsHandle';
or apply the handle to a titlebar etc within the DIV.