That will deactivate handle creation and dragging on that object. Hook that object up to use different classnames on elements and you're set.
Good luck - Angus.
3) SamJJGroup: Guests IP: 202.180.--.--
Posted:
Thanks very much for the reply.
That works perfect.
Sam
4) joeGroup: Guests IP: 151.203.--.--
Posted:
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
5) Angus TurnbullGroup: Moderators Posts: 4235Joined: 7 Dec 2003Location: New ZealandIP: 203.173.--.--
Posted:
Good idea. It would be slightly safer to test if elm.className contains "noresize" and put CLASS="whatever noresize" on the element, but the same kind of idea really!
- Angus.
6) JoeGroup: Guests IP: 151.203.--.--
Posted:
I like the idea of putting noresize in the class attribute. The problem with that is i do a lot of className swapping. Having to filter out names just to swap a class is to much hastle, where just putting noresize as an attribute is so much simpler.
7) AlexGroup: Guests IP: 122.116.--.--
Posted:
It's a useful function, but I find noresize effect only work in IE serials Browser, not work in Firefox Browser (I used FF 2.0.0.11)
8) Angus TurnbullGroup: Moderators Posts: 4235Joined: 7 Dec 2003Location: New ZealandIP: 203.173.--.--
Posted:
Like I was suggesting, browsers are theoretically free to disregard non-W3C properties like "noresize" on an element.
Seriously, if you're already using one of those '$' libraries like jQuery/Prototype, you should have a whole load of addClass or similar methods built in. Just use them and test className. It's not actually any more difficult!
- Angus.
9) AlexGroup: Guests IP: 122.116.--.--
Posted:
Angus:
I only put
function $(v) { return(document.getElementById(v)); } function $S(v) { return(document.getElementById(v).style); }
in my script for DOM locating, do not use jQuery or Prototype...
by the way, In your opion, which library (jQuery, Prototype, Mootools) is best fit for you? I'll pick up one of them to cook my web application
Anyway, your idea and code affected someone programer like us, thks.
10) Angus TurnbullGroup: Moderators Posts: 4235Joined: 7 Dec 2003Location: New ZealandIP: 202.137.--.--
Posted:
Oh, I don't use the major libraries a lot. I've used jQuery a little and it seems alright, plus Prototype has historically extended native objects (booo!). Really, any should work OK.