Tuesday 15 November 2011

IT430 E-Commerce Assignment No.02 Solution (Fall 2011)


Question 1:      (10)

Suppose you have an image mc00000000.jpg (your vu id). You have to create an image map in html by using the given image. The map should have following properties:

1. Use rectangle shape
2. The map area should start from 100 pixels away from top and left border of the image.
3. The height and width of map area should be 100 and 150 pixels respectively.
4. When user clicks on the map area, http://www.google.com should open in a new window.
Solution: 
<map name ="Whatever">
<area shape="rect" coords="0,0,100,100" a href="http://www.google.com" Target="http://www.google.com"/>
<Img src="mc000000.jpg" USEMAP="#Whatever"/>
Explanation:
map name="map-name”
Map name can anything, whatever you will put the map name same you will have to write in front of "USEMAP" attribute.
area   shape="area shape”
Area shape can be circle, rectangle and triangle.
coords="area coordinates”
Coordinates define the area of map to be linked. It breaks down into two pairs of coordinates - namely 0,0 and 100,100. The first pair of coordinates represents the top left corner of the rectangular region and the second pair represents the bottom right corner of the rectangle. That's all it takes to define a rectangular region - two pairs of coordinates.
 href="area hyperlink" or nohref="nohref
This is the URL that you'd like to link the hot spot to. It works just like a standard <code><a href=...></code> tag.
 target="hyperlink target”
This is the optional target window or frame to open the linked URL in. Again, it works just like the <code>target</code> attribute in a standard <code><a href=...></code> tag.
alt="alternate text”
alt stands for alternative text. It is alternative text which will be shown if image cannot be displayed.
usemap="#whatever”
It is the attribute that associates the image map with the image.
 Question 2:        (10)

Suppose you have a media file yourname.mp3 (your name). Your task is to play media file on the html page.  The player should have following properties.
1. The height and width should be 50 and 250 pixels respectively.
2. Media file should play automatically on loading the page.
3. File should play using play button after first loop.

Solution:

<EMBED src= "Your Name.mp3" Autostart="True" Loop="1" width="250" height="50" Controls="console"></EMBED>


Explanation:

<EMBED> is the tag which is used to embed media files (audio/video) into html web page.

 Autostart determines whether or not the display or play of the embeded object will proceed automatically or not.

Loop determines whether or not the displayed audio or video file will loop and the number of times it will loop.  In the Netscape browser true indicates that the embedded file should loop continuously.

Controls determine which console will be used for controlling the play of audio files. (play, stop, pause button etc)

</EMBED> tag will be closed at the end.

No comments:

Post a Comment