Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #26052

Re: Dynamically assign image map values?

From "Jukka K. Korpela" <jkorpela@cs.tut.fi>
Newsgroups comp.lang.javascript
Subject Re: Dynamically assign image map values?
Date 2014-10-30 22:23 +0200
Organization A noiseless patient Spider
Message-ID <m2u6o2$o37$1@dont-email.me> (permalink)
References (3 earlier) <m2rbk4$a71$1@news.albasani.net> <m2rjvi$r6c$1@news.albasani.net> <m2tssv$d2r$1@news.albasani.net> <m2tu5b$lkq$1@dont-email.me> <m2u4te$ubg$1@news.albasani.net>

Show all headers | View raw


2014-10-30 21:52, Tuxedo wrote:

> Given the fact that the coordinates are dynamically generated I may end up
> with decimals in the coordinates, such as 42.699999999999996 etc.
> I guess the browsers ignore fractions or maybe the above becomes a 43
> pixels offset. Still, it appears to work. Maybe I should round the numbers.

Yes, you should round them. HTML specs have been a bit vague on this, 
but HTML5, now finally a W3C Recommendation, mandates that the 
coordinates must be integers:
http://www.w3.org/TR/html5/embedded-content-0.html#attr-area-coords

Although browsers probably round the values if they are not integers, it 
is safer and more logical to do the rounding in your code.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Dynamically assign image map values? Tuxedo <tuxedo@mailinator.com> - 2014-10-29 08:47 +0100
  Re: Dynamically assign image map values? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-10-29 10:25 +0200
    Re: Dynamically assign image map values? Tuxedo <tuxedo@mailinator.com> - 2014-10-29 13:00 +0100
      Re: Dynamically assign image map values? Tuxedo <tuxedo@mailinator.com> - 2014-10-29 19:28 +0100
        Re: Dynamically assign image map values? Tuxedo <tuxedo@mailinator.com> - 2014-10-29 21:50 +0100
          Re: Dynamically assign image map values? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-10-30 07:51 +0200
            Re: Dynamically assign image map values? Tuxedo <tuxedo@mailinator.com> - 2014-10-30 09:44 +0100
          Re: Dynamically assign image map values? Tuxedo <tuxedo@mailinator.com> - 2014-10-30 18:35 +0100
            Re: Dynamically assign image map values? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-10-30 19:57 +0200
              Re: Dynamically assign image map values? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-30 19:46 +0100
                Re: Dynamically assign image map values? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-10-30 20:57 +0200
                Re: Dynamically assign image map values? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-30 21:26 +0100
                Re: Dynamically assign image map values? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-10-30 22:58 +0200
              Re: Dynamically assign image map values? Tuxedo <tuxedo@mailinator.com> - 2014-10-30 20:52 +0100
                Re: Dynamically assign image map values? "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-10-30 22:23 +0200

csiph-web