Articles on Trending Technologies

Technical articles with clear explanations and examples

How to get the scaled height of Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 14-Sep-2022 341 Views

In this tutorial, we are going to learn how to get the scaled height of Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can also find the object’s scaled height by using the getScaledHeight method. Syntax getScaledHeight() Example 1 Using the getScaledHeight method Let’s see a code example to see ...

Read More

How to get the opacity of Text object using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 14-Sep-2022 249 Views

In this tutorial, we are going to learn how to get the opacity of Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can also find the opacity of an object by using the getObjectOpacity method. Syntax getObjectOpacity() Example 1 Using the getObjectOpacity method Let’s see a code example to see ...

Read More

How to get the object scale factor of Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 14-Sep-2022 295 Views

In this tutorial, we are going to learn how to get the object scale factor of Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can also find the object scale factor by using the getObjectScaling method. Syntax getObjectScaling() Example 1 Using the getObjectscaling method Let’s see a code example to ...

Read More

How to disable the centered scaling of Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 14-Sep-2022 459 Views

In this tutorial, we are going to learn how to disable the centered scaling of Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. When being scaled via controls, assigning a true value to the centeredScaling property, uses the center as the object's origin of transformation. Syntax new fabric.Text(text: String, { centeredScaling: Boolean ...

Read More

How to get the value of the rel attribute of a link in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 3K+ Views

In this tutorial, we will learn how to get the value of the rel attribute of a link in JavaScript. The rel attribute expressed the relationship between the current document or website and the linked document or website. The search engine uses this attribute to get more information about the link, so it is important for the SEO of the website. The rel attribute can have different values like alternate, author, external, nofollow, etc.; each value means different information about the link. For example, ‘alternate’ means the link represents an alternate version of the current document. Using document.getElementById() Method In ...

Read More

How to get the value of the id attribute a link in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 9K+ Views

In this tutorial, we will learn how to get the value of the id attribute a link in JavaScript. The id attribute stores a unique value for an HTML element. The id of an element must be unique, and no other elements should not have the same id. The id attribute of a link can be found in different ways, and in this tutorial, we will discuss the most popular ways of doing it− Using document.getElementById() method Using document.getElementsByTagName() method Using document.querySelectorAll() method Using document.getElementById() Method In JavaScript, The document.getElementById() method is useful for getting different attributes value ...

Read More

How to get the value of the hreflang attribute of a link in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 969 Views

In this tutorial, we will learn how to get the value of the hreflang attribute of a link in JavaScript. The hreflang is an attribute of a link or anchor tag which specifies the language of the linked document or href attribute. It is used by search engines to understand the link’s language and the targeted geographical location of the website. For better SEO hreflang attribute must be used. A single language or combination of language and region is used as the value of the hreflang attribute. It uses the language code ISO-639-1 and region code ISO-3166-1. For example: If ...

Read More

What is Green Marketing Myopia?

Abhishek Sengupta
Abhishek Sengupta
Updated on 14-Sep-2022 1K+ Views

What is Green Marketing Myopia? Green marketing myopia is the failure of businesses to comprehend that consumers care just as much about "what's in it for me?" as they do about "how is this good for the environment?" Perhaps even more so. Outside of eco-friendly product attributes, consumers are driven to items that satisfy their goals and requirements (such improved performance or lower cost). Businesses that entirely or significantly rely on promoting the advantages of natural and organic products without taking into account the immediate benefits to consumers may be setting themselves up for failure. Brands have to ...

Read More

What is Marketing Myopia?

Abhishek Sengupta
Abhishek Sengupta
Updated on 14-Sep-2022 482 Views

What is meant by Marketing Myopia? Theodor Levitt first proposed the phrase "market myopia" in a marketing report. In 1960, he made the claim that businesses may do more than merely selling their wares in an article that appeared in the Harvard Business Review. His key argument was that the marketer should put more emphasis on the requirements and satisfaction of the client than on making sales and filling consumers with their goods. He believed that people were living in the "selling idea, " where the goal was to use a push model rather than a pull model to ...

Read More

How to get the value of PI in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 3K+ Views

In this tutorial, we will learn how to get the value of PI in JavaScript. The PI is a mathematical constant that is widely used in different sections of mathematics. It is defined by the ratio of the circumference of a circle to its diameter, which is approximately 3.14159. It is represented by the symbol ‘𝜋’, which is a Greek letter. The value of PI is an Irrational number, which means the value of the PI can’t be expressed as a fraction, and the digits that came after the decimal is non−terminating and non−repeating. The value of PI in JavaScript ...

Read More
Showing 31231–31240 of 61,248 articles
Advertisements