Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    1,063
    Thanks
    2
    Thanked 0 Times in 0 Posts

    img.style.posTop = Math.floor(img.style.posTop)

    img.style.posTop = Math.floor(img.style.posTop)

    I think this doesn't work, that it doesn't floor the number correctly....
    What do you think?

    Edit:
    Now that I think of it, document.write(img.style.posTop) doesn't work either.... How can I operate on the position of an object using Javascript? (I've tried top instead of posTop to no result)
    Last edited by shlagish; 06-08-2003 at 04:50 AM.
    Shawn

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    It should work, what are you trying to do?

  • #3
    Senior Coder
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    1,063
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I'm trying to do this:

    get the position of "img", and make that number a whole number.
    That's because I define the position of "img" with percentages, so I'm not sure it's a whole number. I want it to be a whole number because if it's not, the function I use to move "img" will not work since it goes +1 until it reaches 10 (If it's not a whole number, it will never reach 10)
    You can see that part of my script here
    Shawn


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •