Found 6685 Articles for Javascript

How to change the font size of a Textbox using FabricJS?

Rahul Gurung
Updated on 29-Jul-2022 12:07:45

490 Views

In this tutorial, we are going to see how to change the font size of a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The font size specifies how large or small the characters displayed in our textbox should be. We can change the font size by using the fontSize property.Syntaxnew fabric.Textbox(text: String, { fontSize: Number }: Object)Parameterstext − This parameter accepts a String which is the text string that we ... Read More

How to add stroke to a Textbox using FabricJS?

Rahul Gurung
Updated on 29-Jul-2022 12:04:10

291 Views

In this tutorial, we are going to learn how to add stroke to a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Our textbox object can be customized in various ways like changing its dimensions, adding a background colour, or by changing the colour of the line drawn around the object. We can do this by using the stroke property.Syntaxnew fabric.Textbox(text: String, { stroke : String }: Object)Parameterstext − This ... Read More

How to add shadow to a Textbox using FabricJS?

Rahul Gurung
Updated on 29-Jul-2022 12:00:42

521 Views

In this tutorial, we are going to learn how to add a shadow to a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Our textbox object can be customized in various ways like changing its dimensions, adding a background color, or even adding a shadow to it. We can add a shadow to the textbox by using the shadow property.Syntaxnew fabric.Textbox(text: String, { shadow : fabric.Shadow }: Object)Parameterstext − This ... Read More

How to add dashed stroke to a Textbox using FabricJS?

Rahul Gurung
Updated on 29-Jul-2022 11:57:49

145 Views

In this tutorial, we are going to learn how to add a dashed stroke to a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The strokeDashArray property allows us to specify a dash pattern for the object's stroke.Syntaxnew fabric.Textbox(text: String, { strokeDashArray: Array }: Object)Parameterstext − This parameter accepts a String which is the text string that we want to display inside our textbox.options(optional) − This parameter is an Object ... Read More

Difference between Python and JavaScript

Pradeep Kumar
Updated on 29-Jul-2022 09:03:08

266 Views

JavaScript makes webpages interactive. JavaScript with HTML and CSS improves webpage functionality. JavaScript validates forms, makes interactive maps, and displays dynamic charts. The JavaScript engine in the web browser runs the JavaScript code when a webpage is loaded, which is after HTML and CSS have been downloaded. The HTML and CSS are then changed by the JavaScript code to update the user interface on the fly.JavaScript code is run by a program called the JavaScript engine. At first, JavaScript engines were built like interpreters. Modern JavaScript engines, on the other hand, are usually built as just-in-time compilers that turn JavaScript ... Read More

Difference between Local Storage, Session Storage, and Cookies in JavaScript

Imran Alam
Updated on 01-Nov-2023 02:01:44

39K+ Views

JavaScript provides three mechanisms for storing data on the client − cookies, session storage, and local storage. Each one has advantages and disadvantages.Local storage is the most recent mechanism. It allows for larger amounts of data to be stored, but the data is not deleted when the browser is closed. Local storage is useful for storing data that the user will need to access later, such as offline data.Session storage is similar to cookies, but the data is only stored for the current session. This means that the data will be deleted when the user closes the browser. Session storage ... Read More

Difference between Function.prototype.apply and Function.prototype.call in JavaScript

Imran Alam
Updated on 29-Jul-2022 08:17:33

436 Views

Function.prototype.apply and Function.prototype.call are methods that allow you to call a function with a specific this value and arguments. The main difference between the two is that apply lets you pass in an array of arguments, while call requires you to list the arguments one by one.Function.prototype.applyFunction.prototype.apply is a method that allows you to call a function with a specific this value and an array of arguments.SyntaxThe syntax for using apply is −func.apply(thisArg, argsArray)Here thisArg is the value that will be used as this inside the function. argsArray is an array of arguments that will be passed to the function.ExampleHere’s ... Read More

Difference between JavaScript and HTML

Pradeep Kumar
Updated on 28-Jul-2022 16:10:15

578 Views

There are many different coding languages that can be used when designing websites; some of these languages are more difficult to learn than others. HTML, JavaScript, PHP, CSS, Ruby, Python, and SQL are some of the most widely used languages for developing websites.To comprehend the fundamentals of web design and development, however, all you need to know is HTML and JavaScript, the two key programming languages. Each of these serve a unique function on the web. Since HTML and JavaScript act as the foundation of any website, you need to know how they will affect your website and what they ... Read More

How to convert 3-digit color code to 6-digit color code using JavaScript?

Kalyan Mishra
Updated on 29-Jul-2022 10:38:47

868 Views

In this tutorial, we will see how to convert 3-digit color code to 6-digit color code in JavaScript.So, basically three-digit color code represents the three-digit value of the colour of the form in #RGB format. To convert 3-digit color hex color to 6-digit we just have to do is convert every element of the three digit and make it duplicate.If we say in easy manner, then duplicating the three-digit color will give the hexadecimal whose value is same as three-digit color value.3-digit value: #RGB will be written as #RRGGBB in 6-digit color code.For example, 3-digit value: #08c 6-digit color Code: ... Read More

How to Create an Analog Clock using HTML, CSS, and JavaScript?

Kalyan Mishra
Updated on 26-Jul-2022 14:41:17

3K+ Views

In this tutorial, we will design an Analog Clock by the help of HTML, and CSS and make it work using JavaScript which will show the current time in hour, minute, and second format.ApproachWe will use the Date object and by using some calculations we will show hour, minute, and second.We will get the system time from JavaScript object Date() and this object has functions like getHours(), getSecond() and getMinutes().After getting hour, minute, and second format we will apply to transform rotation for all three needles hour, minute, and second.An analog clock shows time with its three hands moving continuously, ... Read More

Advertisements