Automatically Close Collapsible Elements in Accordion

Dishebh Bhayana
Updated on 22-Feb-2023 11:32:25

2K+ Views

We will use the bootstrap accordion component in our article to demonstrate how to collapse all the children's accordions inside the parent accordion. An accordion is a collapsible component that helps to display an expand/collapse type of content on the webpage. In this article, we will use the Bootstrap 5 Accordion component to display a list of expandable/collapsible elements in a nested fashion. Now, first, we will listen to the “hide” collapse event by attaching an event listener to the parent accordion. After that, when the “hide” collapse event gets fired, we will find all the collapsible elements inside that ... Read More

Automatically Close Alerts Using Twitter Bootstrap

Dishebh Bhayana
Updated on 22-Feb-2023 11:30:51

3K+ Views

We can automatically close the Bootstrap Alert component by using the “close” method and “hide” class provided by Twitter bootstrap. Twitter Bootstrap Alert component is used to display an alert with a message to the user, often in response to a user action or an event. Approach 1: Using Close Method In this approach, we will use the “close” method provided by bootstrap to close the component, and we will use the setTimeout() browser API to achieve this after 5 seconds. Syntax $(alertComponent).alert(‘close’) Here, “alertComponent” is the Bootstrap Alert component, and we are calling the “close” method on this ... Read More

Automatic Refresh a Web Page in Fixed Time

Dishebh Bhayana
Updated on 22-Feb-2023 11:29:41

9K+ Views

We can auto-refresh a web page by either using a “meta” tag with the “http-equiv” property, or by using the setInterval() browser API. Automatic refreshing websites have certain use cases to them, for example, while creating a weather-finding web application, we may want to refresh our website after a set interval of time to show the user the near-exact weather data for a location. Let’s look at the 2 approaches below to understand how to set up an auto-refreshing website. Approach 1 In this approach, we will use the “http-equiv” property of a “meta” tag to refresh our web application ... Read More

Auto-Suggest Rich Content in Google AMP

Dishebh Bhayana
Updated on 22-Feb-2023 11:28:31

129 Views

To implement auto-suggestion of rich content to the user during the typing of an input field, we will use the “amp-autocomplete” script from the Google AMP framework. Autocompleting an input field implies suggesting relevant content to the user as and when the user starts typing. Let’s discuss the approach with an example, below − Approach We will use the “amp-autocomplete” script to add auto-suggestion of rich content on our webpage. We will also use the “amp-form” script from the Google AMP framework so as to use its amp-form component and display it in the UI, and the “amp-mustache” to give ... Read More

Auto Adjust Font Size Using CSS

Dishebh Bhayana
Updated on 22-Feb-2023 11:26:50

1K+ Views

We can adjust the font size of the text using the “font-size-adjust” property given to us by the CSS. The “font-size-adjust” property allows us to adjust to a common font size regardless of the different font families used in the document if any. With this, we can adjust the font size of the lower-case letters, used in the document, with respect to the font size of the uppercase letters in the document. Syntax font-size-adjust: number | initial | none | inherit | revert | revert-layer | unset “font-size-adjust” can take on many values that are listed above. These values ... Read More

Use Simple Queue Instead of Priority Queue for Dijkstra's Algorithm

Sonal Meenu Singh
Updated on 22-Feb-2023 11:25:00

3K+ Views

Introduction Dijkstra’s Algorithm is used to find the shortest possible distance between two objects. To implement this algorithm we mostly use Priority Queue. In this tutorial, we will find the answer to whether can we use a simple queue to implement Dijkstra’s algorithm instead of a Priority Queue. What is a Priority Queue and A Queue? A queue is a linear array of data. It represents the Queue of real life. A simple Queue uses FIFO (First In First Out) approach for its deQueue and enQueue operations. A priority Queue is a type of Queue that deQueue its elements with ... Read More

Basic Operations for Queue in Data Structure

Sonal Meenu Singh
Updated on 22-Feb-2023 11:23:18

961 Views

Queue is a collection of different data types and is an important part of data structure, following a particular order to insert and remove elements. In this tutorial, we will understand the basic operations of the queue. What is Queue in Data Structure? A Queue is a linear data structure that resembles a queue in real life. You all have been part of some queue in school, the billing counter, or any other place, where the one entered first will exit first in the queue. Similarly, a queue in data structure also follows the FIFO principle, which defines First In ... Read More

Arrange Text in Multi Columns Using CSS3

Dishebh Bhayana
Updated on 22-Feb-2023 11:22:31

83 Views

To arrange text in multi-columns we are using the “column-count” property of CSS3. The “column-count” property is used to divide an HTML element’s content into the number of columns specified. Here we are going to use two different example to demonstrate the application of “colum count” property of CSS to arrange text in 2 and 3 columns. Syntax column-count: n; Here, “n” is the positive integer value that represents the number of columns we want to arrange the text into. Example 1 In this example, we will arrange a “p” tag’s content into 3 columns by using ... Read More

Difference Between Array-Based Queue and List-Based Queue

Sonal Meenu Singh
Updated on 22-Feb-2023 11:17:31

1K+ Views

Introduction A queue is a linear data structure that inserts and removes queue elements in a particular order. We can implement a queue in C++ by using arrays and a linked list. Both queue implementations have their benefits and uses. In this tutorial, we will differentiate the array-based Queues and List Based Queues. What is a Queue? A Queue is a series of elements that uses the FIFO principle for the insertion and deletion of its elements. A queue in Computer Science resembles the queue of real life where the one who enters first in the queue, will be removed ... Read More

Join Two Linked Lists in Golang

Akhil Sharma
Updated on 22-Feb-2023 11:12:10

452 Views

In Go, a linked list is a linear data structure that contains a node which further contains two fields one is data and the other one is next. The next contains the address of the next node in continuation. We will execute this program with the help of two methods. In the first method linked list will be used a series of nodes and in the second example different variables are used to execute the program. Method 1 − Using linked list as series of nodes A linked list is described by this program as a collection of Nodes, each ... Read More

Advertisements