How can I incorporate an image map into a fluid layout?

后端 未结 3 935
梦谈多话
梦谈多话 2021-02-10 16:04

I am currently having a huge headache trying to get a site I\'m building to work across variable resolutions. The main navigation is through an image map that needs to fill most

3条回答
  •  孤独总比滥情好
    2021-02-10 16:45

    Edit: The percent approach doesn't work.

    In that case, the only thing I can see goes like this:

    Have shapes using percent notation:

     
    

    On the first draw and on every window resize:

    • parse each area's mycoords property

    • Split percentages into four integers

    • Calculate percentages based on the image's .width() property

    • Set the area's coords property based on the thusly calculated pixel values

    Not entirely trivial, but this should be halfway easy to implement by a seasoned jQueryist.

    Old answer:

    Hmm. So you have an imagemap that needs to resize dynamically?

    I have never tried this myself, but what about using relative coordinates=

     
    

    No idea whether this works, but worth a try.

提交回复
热议问题