60 likes | 74 Views
Image Map. You can define a region on your image as clickable. Add usemap=“mapname” parameter to your image. Add a <map> tag to your html where name of map tag is “mapname”. Three kinds Rect angle Circle Poly gon. Image Map. <map name=“mymap”>
E N D
Image Map • You can define a region on your image as clickable. • Add usemap=“mapname” parameter to your image. • Add a <map> tag to your html where name of map tag is “mapname”. • Three kinds • Rectangle • Circle • Polygon
Image Map <map name=“mymap”> <area shape=rect coords=“...” alt=“...” href=“...”> </map> • Parameters of map: • Name: name of image map. • Parameters of area: • Shape: shape of area: rect, circle, poly • Coords: coordinates (next slide) • Alt: Alternative text. • Href: link.
Shape Coordinates X • Shape types and coordinates: • shape=rect coords="left-x, top-y, right-x, bottom-y" • shape=circle coords="center-x, center-y, radius" • shape=poly coords="x1,y1, x2,y2, x3,y3, ..." Y
Add an image map to your html http://www.bilkent.edu.tr/~ussakli/images/logos.gif • Add above image to the top of your page and display it. • Add a map tag to somewhere in body of your html, with a name “logosmap”. <map name=“logosmap”> </map> • Add a parameter to your image to use this map: usemap=“#logosmap"
Add an image map to your html • Add a rectangle with coordinates “3, 3, 96, 74” with alternative text “Adidas Web Site”, with a link http://www.adidas.com and target to Sports window. • See if it works. • Do the same thing to get the following result. <img src=logos.gif usemap=#logosmap> <map name=“logosmap” > <area shape="rect" coords="3,3,96,74" href="http://www.adidas.com" target="sports" alt="Adidas Web Site" /> <area shape="circle" coords="149,42,40" href="http://www.nike.com" target="sports" alt="Nike Web Site" /> <area shape="rect" coords="3,128,97,175" href="http://www.bbc.com" target="news" alt="BBC Web Site" /> <area shape="poly" coords="104,143,115,125,180,127,188,140,188,177,105,177" href="http://www.cnn.com" target="news" alt="CNN Web Site" /> </map>