Is there a way to show a div without resizing options? Getting it more complex... is there a way to get divs that can be resized and others no on the same page?
I tried by removing Individual corner classes and layers work fine without resizing options but what if i need both behaviors?
And by the way is there another page where i can see more examples?
I really appreciate your support.
Thanks in advance.
Larry.
2) Angus TurnbullGroup: Moderators Posts: 4235Joined: 7 Dec 2003Location: New ZealandIP: 203.173.--.--
Posted:
There's only one example at the moment.
I'd try creating two DragResize objects, each with different names, and disabling resize in one of them (just set the resize functions equal to null). That is:
var dragonly = new DragResize('dragonly'); dragonly.resizeHandleSet = null; dragonly.resizeHandleDrag = null; dragonly.isElement = ... // copy and paste this changing drsElement to something else. dragonly.apply(document);
Then give appropriate classes to the DIVs and you're away!
Hi, Thanks for your answer, i'll code your suggestion on my page.
I have another question, i want to put the absolute DIV and also having the protection of the backgorund, i mean, like a modal pop up. To do that i create a js function ShowPopUp that launch your DIV and i need the backgorund to be protected preventing changes while DIV is shown. I tried something like that
.drsFrame { display:none;/*sorry for IE5*/ display/**/:block;/*sorry for IE5*/ position:absolute;/*must have*/ top:0;/*must have*/ left:0;/*must have*/ z-index:91;/*must have*/ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=60); /*filter:mask();/*must have*/ -moz-opacity: 0.60; width: 100%;/*must have for any big value*/ height: 100%;/*must have for any big value*/ } /* downloaded from internet*/
My custom function just set visible (css) to none or ' ' depending the case and at the same time set visible property of the iframe element.
Works great! DIV is shown over the page, preventing changes on the backgorund content, but when i just click or try to drag the DIV it becomes part of the protected backgorund. I know your function is for multiple DIVs on the page and i believe it could be the problem i have.
So Is there a way to show and drag/drop the DIV over the protected backgorund?
I hope you really get my point (my english is poor),
Thanks.
Larry.
4) Angus TurnbullGroup: Moderators Posts: 4235Joined: 7 Dec 2003Location: New ZealandIP: 202.137.--.--
Posted:
Give the DIV that you are dragging a high z-index and it should work a lot better. The script adjusts z-indexes of elements internally as you drag them so you might have to tweak that bit of code too perhaps if it still doesn't work well.
Good luck - Angus.
5) JoeGroup: Guests IP: 151.203.--.--
Posted:
I found an easier way to get an element to be resized or not. I found a peice of code that was not used (_handle_tr). So I moved the three lines (294-296) Up into the IF section, and by doing that just set _handle_tr=true in the element to disable resize. Code Seg... DragResize.prototype.resizeHandleSet = function(elm, show) { with (this) { // Either creates, shows or hides the resize handles within an element.
// If we're showing them, and no handles have been created, create 4 new ones. if (!elm._handle_tr) { for (var h = 0; h < handles.length; h++) { // Create 4 news divs, assign each a generic + specific class. var hDiv = document.createElement('div'); hDiv.className = myName + ' ' + myName + '-' + handles[h]; elm['_handle_' + handles[h]] = elm.appendChild(hDiv); } // We now have handles. Find them all and show/hide. for (var h = 0; h < handles.length; h++) { elm['_handle_' + handles[h]].style.visibility = show ? 'inherit' : 'hidden'; } } }};
Sorry, I made a mistake in the last post... please disreguard it... this is what i did. I found a way to set Any obect non-resizeable and only dragable, by making a change to the code... I included a line in the function:
DragResize.prototype.resizeHandleSet = function(elm, show) { with (this) { // Either creates, shows or hides the resize handles within an element. if (!elm.noresize) { // added line
and at the end of the function I added a }
Now, anytime i want to disable re-sizing, i just add noresize=true to the element