Lock Horizontal Skewing of Textbox Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 12:09:09

212 Views

In this tutorial, we are going to learn how to lock the horizontal skewing of a Textbox using FabricJS. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also specify whether we want to stop skewing an object horizontally. This can be done by using the lockSkewingX property. Syntax new fabric.Textbox(text: String, { lockSkewingX : Boolean }: Object) Parameters text − 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

Lock Horizontal Scaling of Textbox Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 12:06:20

411 Views

In this tutorial, we are going to learn how to lock the horizontal scaling of a Textbox using FabricJS. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also specify whether we want to stop scaling an object horizontally. This can be done by using the lockScalingX property. Syntax new fabric.Textbox(text: String, { lockScalingX : Boolean }: Object) Parameters text − 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

Lock Horizontal Movement of Textbox Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 12:01:55

148 Views

In this tutorial, we are going to learn how to lock the horizontal movement of a Textbox using FabricJS. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also specify whether we want it to move only in the Y-axis. This can be done by using the lockMovementX property. Syntax new fabric.Textbox(text: String, { lockMovementX: Boolean }: Object) Parameters text − 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

Display String as Superscript Using JavaScript

Shubham Vora
Updated on 02-Aug-2022 11:40:17

3K+ Views

In this tutorial, we are going to learn to change strings to be displayed as a superscript using JavaScript. As the name suggests, the superscript string is displayed at the half-height of the normal string. Also, characters of the superscript string are smaller than the normal string characters.There are a lot of uses of the superscript string while writing the mathematical formulas. For example, A2, B2, 105, etc. Also, we can use the superscript to show the chemical formulas such as O22-, H-, etc.Here, using HTML or JavaScript, users can learn to display string as a superscript.Display string as subscript ... Read More

Change String to Subscript using JavaScript

Shubham Vora
Updated on 02-Aug-2022 11:32:20

3K+ Views

In this tutorial, we will learn to change the string displayed as a subscript using JavaScript. The meaning of the subscript string is a string that displays right after the string with a small letter and hangs below. For example, In the Astart, ‘start’ is the subscript string shown in the small letter right after A and hangs below. The substring uses in many fields such as Mathematics, chemicals, etc. It is useful to represent the chemical name. For example, H2, N2, O2, etc. Also, we can use it in mathematics to show the symbols such as X2, A2, etc. ... Read More

Change Button Label in Confirm Box Using JavaScript

Shubham Vora
Updated on 02-Aug-2022 11:29:10

14K+ Views

In this tutorial, we will learn to change the button label in the confirm box using JavaScript. The confirm box is useful for taking the confirmation from the user. For example, when you try to delete something from your account on some websites, they show you a popup box containing a message like “Are you sure to delete ….?”. Also, it contains the yes and no buttons, which is one kind of confirmation the application takes from the users. JavaScript users can create the confirm box using the .confirm() method, which contains the confirmation message string, ok, and cancel button. ... Read More

Center a Popup Window on Screen Using JavaScript

Shubham Vora
Updated on 02-Aug-2022 10:01:33

11K+ Views

In this tutorial, we will learn to center a popup window on the screen using JavaScript. Programmers often need to open a new popup window to show another webpage without redirecting the user to the other webpage. In this situation, developers use the window.open() method to open the new browser window. Also, we can style the popup window and set the height and width. Also, we can change the position of the popup window to look it better. Sample Popup Window In this section, we will create a sample popup window to get familiar with the how window.open() method works. ... Read More

Convert Infinity to String in JavaScript

Shubham Vora
Updated on 02-Aug-2022 09:52:54

694 Views

This tutorial will teach us how to convert the infinity to string in JavaScript. The Infinity is the reserved keyword in JavaScript and demonstrates the concept of the infinity number of mathematics. It is a global variable, and we can access it anywhere in our program. Here, we have two approaches to converting the infinity number to a string in JavaScript. Using the String() Constructor Using the toString() Method Using the String() Constructor The JavaScript contains the class for the variable of every data type and its related method. It also contains the string class and which is ... Read More

Are JavaScript Functions Object Methods?

Shubham Vora
Updated on 02-Aug-2022 09:47:35

210 Views

Compared to other languages, JavaScript works differently, especially if you get confused between function and methods. In this tutorial, we will learn whether JavaScript functions are object methods. The example written in this tutorial gives you a better idea about the differences and which one is more convenient for us. What are JavaScript Functions? Functions are generally used to define a particular task that we want to perform. It is a set of instructions, and every function has its block of code. Functions can also have parameters by performing desired operations on those parameters. Syntax The syntax for the ... Read More

Convert JavaScript Date to UTC

Shubham Vora
Updated on 02-Aug-2022 09:41:10

14K+ Views

In this tutorial, we will learn to convert the date to UTC. The full form of the UTC is the universal time coordinate, and it is a standard time that is considerable in every country. Let’s understand the need to convert the date to UTC by example. You have created the chat application. Users from various countries are using your application. Suppose that one user is from the USA and another from India. Both have a different time zone. So, you can either show the user to message received or send time in the local time or the UTC. There ... Read More

Advertisements