bounding boxes

  • Started
  • Last post
  • 2 Responses
  • aliendn

    sup,
    an ignorant question on my part, but when doing rollovers in html, is there a concept of something called a bounding box that defines the area where a button is clickable?

    if so, is this area determined by size of the button, or can you define it where ever you want. its my first time hearing about a bounding box, and i always use dreamweaver, so i may be ignnorant of the code going on.

    any tutorials or insight would be appreciated,
    CHeersNadvance

  • sp0

    You might be able to alter the size of a clickable bounding box using CSS, DOM and/or Javascript. But I doubt there is a way to alter shape.

    You can expand the clickable area of a text link by using padding and margins in CSS on the A tag and it's surrounding DIV, but careful...it will only work in certain browsers.

    You could use Image Maps to do this, but that requires your clickable area to be all images. It can be a strain on loading - depending on connection speeds.

  • mitsu0

    creating bounding boxes is really simple. just set up a pseudo rect stucture to specify what you want the dimensions to be, then with a little math determine the offset of the bounding box in relation to the objects position on the screen.

    though, this is kind of overdoing it if you can just use a div or span.