Code:
- <script>
- function RePos(WinID,X,Y){
- get(WinID,'id').style.top = Y;
- get(WinID,'id').style.left = X;
- }
- </script>
I call it using onclick="RePos('the-id',50,50);"
You'd need to give the element some form of positioning - absolute or fixed etc...![]()
It has fixed
i'm assume by the positioning is in the onclick feature?
the 50,50 ?
It has fixed
Is it working?
The code isn't
What's the forum link so that I can take a look.![]()
The Final Anime Hideout (In my sig)
You don't actually need the code that you have in there at the moment from the looks of it,it doesn't do anything! O.o
I have a code that makes some spans draggable, I want this code to move them back
Code:
- <script>
- function RePos(WinID,X,Y){
- get(WinID,'id').style.top = Y;
- get(WinID,'id').style.left = X;
- }
- </script>
- <div id = 'x' onclick = "RePos('x', '500px', '500px');" style = 'position: fixed; padding: 50px; border: 1px solid #000000; background: #800000; color: #FFFFFF;'>
- This is a repositionable box!
- </div>
That code works fine.![]()
Maybe I just called it wrong
Edit: Yep, I did call it wrong with the X and Y, works now
You'll need to include the 'numberpx' in it. Without the px declaration it won't recognise what you want to do. At least my testing revealed that. You can either throw it into the function, or the call.![]()
It works really good now
Good to know!![]()