That is because you call Prototype method 'this.clonePosition' by
clicking your button. In this case 'this' - is the button itself
(extended element). You need to rename your 'clonePosition' function.

On May 13, 2:54 pm, Alaa <[email protected]> wrote:
> Hello,
> From it is name I expect that the two elements will have the same
> position after cloning the position, but nothing happens!!!
>
> here is the example
> <html>
> <head>
> <title>Prototype examples</title>
> <script type="text/javascript"
>    src="/javascript/prototype.js">
> </script>
> <script>
>
> function clonePosition(){
>    var firstElement = $('firstDiv');
>    var secondElement = $('secondDiv');
>    secondElement.clonePosition( firstElement);
>
> }
>
> </script>
> </head>
>
> <body>
>
>    <p>Click Clone Position button to see the result.</p>
>    <div id="firstDiv">
>       <p>This is first paragraph</p>
>    </div>
>
>    <div id="secondDiv">
>       <p>This is second paragraph</p>
>    </div>
>
>    <br />
>    <input type="button" value="Clone Position"
>              onclick="clonePosition();"/>
>
> </body>
> </html>
>
> So, is that a bug, or I have some mistakes, or it is not doing as I
> have understood???
>
> help please

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to