Hover the mouse on this line.
the code, the hover() method is used In the mouse is placed on the text, then the background color changes to When red the user moves the mouse outside the text, the background color changes When to maroon © Aptech Ltd Canvas and JavaScript / Session 17 42 figure displays Following the mouseenter effect © Aptech Ltd figure displays Following the mouseleave effect Canvas and JavaScript / Session 17 43 Ø toggle() event toggle() event works in a similar manner as that of the hover() event, The except that it responds to mouse clicks toggle() funcUon accepts more than two funcUons as arguments The the funcUons passed to the toggle() event will react to its corresponding click All acUon The Code Snippet demonstrates the toggle event function(){ $(“body”).css(“background-color”,”grey”);} ); }); $(document).ready(function(){ $(“p”).toggle(function(){ $(“body”).css(“background-color”,”blue”);},Click to change the colors.
function(){ $(“body”).css(“background-color”,”pink”);}, © Aptech Ltd Canvas and JavaScript / Session 17 44 the code, the toggle() method is used In the user clicks the text then the background-color of the document When is changed to blue, pink, and grey respecUvely figure displays Following figure displays Following the toggle effect to blue the toggle effect to pink © Aptech Ltd Canvas and JavaScript / Session 17 45 Following figure displays the toggle effect to grey © Aptech Ltd Canvas and JavaScript / Session 17 46 HTML5 introduces the tag that allows the user to push external content in the Web page This model is referred to as push model Since the tag is not supported in many browsers, users make use of the tag for this purpose The tag is a new element in HTML5 and it is represented as a container for an interactive content or an external application The tag is often used to add elements such as image, audio, or video on a Web page The Code Snippet demonstrates the use of tag In this code, the src aPribute specifies the path of an external file to embed © Aptech Ltd Canvas and JavaScript / Session 17 47 element is a drawing area where the user can draw graphics, use The images, add animaUons, and also add text for enhancing the user experience on Web pages create a line, on a canvas one can use the stroke(), beginPath(), lineTo(), and To moveTo() methods Arcs are represented using a start angle, an end angle, a radius, a center point, and the drawing direcUon (anUclockwise or clockwise) With HTML5 canvas, the user can create a rectangle using the rect() method Bezier curves are represented with the two control points, context points, and an end point HTML5 canvas allows the user to create quadraUc curves using the quadraUcCurveTo() method canvas enables the user to draw image object on canvas using the HTML5 drawImage() method © Aptech Ltd Canvas and JavaScript / Session 17 48 ...Canvas in HTML5 Describe Explain the procedure to draw lines the procedure to use color and transparency Explain Explain the procedure to... Canvas and JavaScript / Session 17 Following figure displays the element © Aptech Ltd Canvas and JavaScript / Session 17 can create lines in... Canvas and JavaScript / Session 17 11 Following figure displays a line drawn in a canvas © Aptech Ltd Canvas and JavaScript / Session 17 12 canvas allows