The clearQueue() method in jQuery is used to remove all items from the queue.SyntaxThe syntax is as follows −$(selector).clearQueue(queue)Above, the queue is the name of the queue.ExampleLet us now see an example to implement the jQuery clearQueue() method − Live Demo $(document).ready(function(){ $(".button1").click(function(){ var div = $("div"); div.animate({height: 250}, "slow"); div.animate({left: "+=200", top: "+=100" }, "slow"); $("span").text(div.queue().length); }); $(".button2").click(function(){ $("div").clearQueue(); }); }); ... Read More
The imagefill() function is used to fill the image.Syntaximagefill(img, x, y, color)ParametersimgCreate a blank image with imagecreatetruecolor().x x-coordinate of start pointy y-coordinate of start pointcolor The fill color.ReturnThe imagefill() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:
The imagedashedline() function draws a dashed line.Syntaximagedashedline( $image , $x1 , $y1 , $x2 , $y2 , $color )Parametersimage Create a blank image with imagecreatetruecolor().x1 Upper left x-coordinatey1 Upper left y-coordinatex2 Bottom right x-coordinatey2 Bottom right y-coordinatecolor The fill color.ReturnThe function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:
The imagefilledrectangle() function draws a filled rectangle.Syntaximagefilledrectangle( $img, $x1, $y1, $x2, $y2, $color )Parametersimage Create a blank image with imagecreatetruecolor().x1x-coordinate for point 1.y1 y-coordinate for point 1.x2 x-coordinate for point 2.y2 y-coordinate for point 2.color The fill color.ReturnThe imagefilledrectangle() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:
The imagefilledellipse() function is used to draw a filled ellipse.Syntaximagefilledellipse( $img, $cx, $cy, $width, $height, $color )Parametersimg This creates a blank image with imagecreatetruecolor()cx x-coordinate of the center.cy y-coordinate of the center.width The ellipse width.height The ellipse height.color The fill color.ReturnThe imagefilledellipse() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:
To set background color using CSS, use the background-color property.ExampleLet us now see an example − Live Demo .demo { text-decoration: overline underline; background-color: red; } Details Examination Center near ABC College. Exam begins at 9AM. OutputExampleLet us now see another example − Live Demo .demo { text-decoration: overline underline; } Details Examination Center near ABC College. Exam begins at 9AM. Output
With relative positioning, the element is positioned relative to its normal position. For this, use position: relativeExampleLet us now see an example − Live Demo div.demo { position: relative; color: white; background-color: orange; border: 2px dashed blue; left: 50px; } Demo Heading This is demo text. This is demo text. position: relative; This is another demo text. Output
With static positioning, the elements are not affected by the top, bottom, left, and right properties. For this, use position: static.ExampleLet us now see an example − Live Demo div.static { position: static; color: white; background-color: orange; border: 2px dashed blue; } Demo Heading This is demo text. This is demo text. position: static; This is another demo text. Output
To set line height, use the line-height property. Followng are the property values −line-height: normal|number|length|initial|inherit;ExampleLet us now see an example − Live Demo div { line-height: 1.9; } Demo Heading This is demo text. This is another demo text. OutputExampleLet us now see another example − Live Demo div { line-height: 200%; } Demo Heading This is demo text. This is another demo text. Output
The looping features in python can be used to create many nicely formatted diagrams using various characters from the keyboard. One such shape is diamond shape which will involve multiple loops. This is because we have to print the character both vertically and horizontally. Also we have to take care of the shape gradually growing from top till middle and then gradually shrinking from middle till the bottom. For this reason, we will use two for loops each containing one more for loop inside it.Below is the code for creating the diamond shape.Exampledef Shape_of_Diamond(shape): a = 0 for m in ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP