I'm trying to understand something about this example from the API
docs re: Element.addMethods:
Element.addMethods({
wrap: function(element, tagName) {
element = $(element);
var wrapper = document.createElement('tagName');
element.parentNode.replaceChild(wrapper, element);
I try to make dnd for pieces on Shogi board. My approach is:
when a user starts to drag a piece, I make these fields on the board
that the piece can move to droppable.
Shogi board is 9x9 DIVs structure so there could be about 81
droppables.
Dragged element is an IMG.
I made an example with 76
Hiya,
...wouldn't element always refer to a node in
the DOM already? Is there a case where the method could fail if that
first line is not included?
The functions in the Element class are available both as class methods
and as instance methods. What you're defining is the class method,
Hello, I love Prototype.js, it's sort of the miracle we have been
waiting for.
All hard coded examples I have tried work great, but for some reason
when I try to get dynamic (one sendRequest() for a group of controls
for example) I can not get something that works.
Maybe I am not allowed to do
Hi Stuart,
The id attribute _must_ be unique within the page, that's part of the
HTML standard. You can have multiple inputs with the same name
attribute, but not the same id. When adding the further inputs,
you'll need to give them unique ids like 'forename0', 'forename1',
'forename2', etc.
Hi,
Sorry, typo above. Where I said
var forenames = inputs.invoke('getValue');
'vals' is now an array with the values of all of the forenameX inputs.
I did of course mean 'forenames', not 'vals'.
-- T.J.
On Jun 21, 12:54 pm, T.J. Crowder t...@crowdersoftware.com wrote:
Hi Stuart,
The
sorry about the repeated response... apparently my phone's email client had not
updated new messages.
-Original Message-
Date: Sunday, June 21, 2009 1:46:13 pm
To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com
From: Stuart stuart.ga...@googlemail.com
Subject:
Hi fat bold cyclop,
to retriev the X/Y position of an element, go and have a look at
http://prototypejs.org/api/element/cumulativeoffset and
http://prototypejs.org/api/element/cumulativescrolloffset depending if
there is scroll or not.
Both return coordonate of the element, Then you just need
Hi Dan,
the trouble is that you use the margin: 0px auto; in #centreWrapper
CSS properties. To understand, try to change width of the viewport.
By removing the attribute, it's well positionned.
perhaps another way to center the div ??
--
david
On 18 juin, 16:26, BillyRayPreachersSon