www.webdeveloper.com
Results 1 to 6 of 6

Thread: image map command problem

  1. #1
    Join Date
    Dec 2012
    Posts
    3

    image map command problem

    image map command problem.

    <img sec=”commandline.jpg” usemap=”#commandmap”/>
    <area cords”0,0,10,30” href=”page1.htm” shape=”rect” />
    <area cords”11,0,20,30” href=”page2.htm” shape=”rect” />
    <area cords”21,0,30,30” href=”page3.htm” shape=”rect” />
    <area cords”31,0,40,30” href=”page4.htm” shape=”rect” />

    wrote image map into 4 rectangle areas pointing to four different html pages.

    Each page has the same image map with same map name as above.

    However, when I click page1, then in page1 I click page2, it gets mixed up calling for “page1.htm page2.htm”

    What did I do wrong?

  2. #2
    your forget to add MAP tag, try this:
    <img src="commandline.jpg" usemap="#commandmap" name="commandmap" />
    <map name="commandmap">
    <area cords"0,0,10,30" href="page1.htm" shape="rect" />
    <area cords"11,0,20,30" href="page2.htm" shape="rect" />
    <area cords"21,0,30,30" href="page3.htm" shape="rect" />
    <area cords"31,0,40,30" href="page4.htm" shape="rect" />
    </map>

  3. #3
    Join Date
    Oct 2012
    Posts
    17
    You have to define coordinate parameter patterns: Put different area shape code where the page is using map command

  4. #4
    Join Date
    Dec 2012
    Posts
    3
    thanks, actuall in my code I do have
    <map name="commandmap">
    ===
    ===
    </map>
    I have to use the same area shape because the jpg is same one, and same location, for all different html page.

  5. #5
    Join Date
    Mar 2011
    Posts
    1,135
    Don't use the same value 'commandmap' for the 'name' attribute on both the <img> and <map> tags. The 'name' attribute must be unique or the browser will not find it.
    Rick Trethewey
    Rainbo Design

  6. #6
    Join Date
    Dec 2012
    Posts
    3
    My actual code is:
    <img src="commandline.jpg" usemap="#commandmap" />
    <map name="commandmap">
    <area cords"0,0,10,30" href="page1.htm" shape="rect" />
    <area cords"11,0,20,30" href="page2.htm" shape="rect" />
    <area cords"21,0,30,30" href="page3.htm" shape="rect" />
    <area cords"31,0,40,30" href="page4.htm" shape="rect" />
    </map>

    wrote image map into 4 rectangle areas pointing to four different html pages.
    Each page has the same image map with same map name as above.
    However, when I click page1, then in page1 I click page2, it gets mixed up calling for “page1.htm page2.htm”

    What did I do wrong?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles