Display Flex Items Vertically on Different Screen Sizes in Bootstrap 4

David Meador
Updated on 15-Jun-2020 18:56:33

1K+ Views

To show flex items vertically on different screen sizes, use the flex-*- column class. For small, medium and large screen sizes, use it as −For Small screen size −For Medium screen size −For Large screen size −Let us see an example to learn how to set flex items vertically on different screen sizes −ExampleLive Demo       Bootstrap Example                             Example     Note: Change the browser size to see the effect.     Default           One       Two       Three         Flex on differet screen size (Medium)           One       Two       Three         Flex on differet screen size (Large)           One       Two       Three    

Activate Content as a Bootstrap Modal

David Meador
Updated on 15-Jun-2020 18:52:21

563 Views

If you want to set content as a Bootstrap modal, then use the .modal(options) method.On button click, the modal generates as in the following script.$(document).ready(function(){   $("#button1").click(function(){     $("#newModal1").modal({backdrop: true});   }); });Above, I have set options as “backdrop:true”. Another option, we can set is “backdrop: true” −backdrop: true =  Clicking outside the modal, close it.backdrop: false = Clicking outside the modal, won’t close it.You can try to run the following code to implement the modal(“options”) class −ExampleLive Demo       Bootstrap Example                     ... Read More

Hide Bootstrap Modal

Amit Diwan
Updated on 15-Jun-2020 18:46:03

2K+ Views

The .modal(“hide”) method hides the modal on button click.Firstly, generate the modal and display it −$("#newModal").modal("show");After that, use the modal(“hide”) method on a button to hide the modal on button click −$("#button1").click(function(){   $("#newModal").modal("hide"); });Let us see an example of the modal(‘hide”) method wherein we are hiding a modal which generates on page load −ExampleLive Demo       Bootstrap Example                             #button1 {       width: 140px;       padding: 20px;       bottom: 150px; ... Read More

Align Rows of Items at the Baseline in Bootstrap 4

Amit Diwan
Updated on 15-Jun-2020 18:43:33

223 Views

Align single rows of items at the baseline in Bootstrap 4, use the .align-items-baseline class.To align at the baseline:

Manacher's Algorithm

karthikeya Boyini
Updated on 15-Jun-2020 18:40:57

718 Views

To find the longest palindromic substring from a string, we can use Manacher’s Algorithm. By selecting each character, we will try to find if there any palindrome using left and right pointer. There is another array to store information, from that information we can easily find how long the palindrome is. For each character, the array will store information. After traversing the whole string, we can find the longest palindromic subsequence from the created array.The time complexity of this algorithm is O(n).Input and OutputInput: String: “levelup” Output: Longest palindrome is: levelAlgorithmlongestPalindrome(text)Input − The text to find the longest palindromeOutput − ... Read More

Stretch Gathered Items on Different Screens in Bootstrap 4

Ricky Barnes
Updated on 15-Jun-2020 18:37:35

148 Views

Use the .align-content-*-stretch in Bootstrap 4 to stretch gathered items on different screens.To stretch items on different screens −Stretch items on Small Screen   Work 1   Work 2   Work 3   Work 4   Work 5   Work 6 Stretch items on Medium Screen   Work 1   Work 2   Work 3   Work 4   Work 5   Work 6 Stretch items on Large Screen   Work 1   Work 2   Work 3   Work 4   Work 5   Work 6 Let us see an example to stretch gathered items on different screen size ... Read More

Naive Pattern Searching

Sharon Christine
Updated on 15-Jun-2020 18:34:58

6K+ Views

Naïve pattern searching is the simplest method among other pattern searching algorithms. It checks for all character of the main string to the pattern. This algorithm is helpful for smaller texts. It does not need any pre-processing phases. We can find substring by checking once for the string. It also does not occupy extra space to perform the operation.The time complexity of Naïve Pattern Search method is O(m*n). The m is the size of pattern and n is the size of the main string.Input and OutputInput: Main String: “ABAAABCDBBABCDDEBCABC”, pattern: “ABC” Output: Pattern found at position: 4 Pattern found at ... Read More

Hide Bootstrap Modal Event

Amit Diwan
Updated on 15-Jun-2020 17:52:24

748 Views

The hide.bs.modal event in Bootstrap fires when the modal is about to be hidden.The following button hides the modal −   Click to hide Just after clicking the hide button, the hide.bs.modal event fires and before the modal is hidden.  Here is the script for the hide.bs.modal event:$("#newModal").on('hide.bs.modal', function () {   alert('The modal is about to be hidden.'); });The following is the complete example to implement the hide.bs.modal event in Bootstrap −ExampleLive Demo       Bootstrap Example                           ... Read More

Bootstrap 4 Class for Single Flex Item to Take Up Available Space

Alex Onsman
Updated on 15-Jun-2020 17:49:44

349 Views

In Bootstrap 4, if you want a flex item to take up the available space, then use the flex-grow-|1 class.If you want the first flex item to take up the space, then the following is the code −   One   Two   Three Above you can see, I have used the flex-grow-1 class in the first div class −   One The following is an example to implement the flex-grow-0|1 class −ExampleLive Demo      Bootstrap Example                      

Anagram Pattern Search

karthikeya Boyini
Updated on 15-Jun-2020 17:47:44

648 Views

Anagrams are basically all permutations of a given string or pattern. This pattern searching algorithm is slightly different. In this case, not only the exact pattern is searched, it searches all possible arrangements of the given pattern in the text.To solve this problem, we will divide the whole texts into several windows of length same as patterns. Then count on each character of the pattern is found and stored in an array. For each window, we also try to find the count array, then check whether they are matching or not.The time Complexity of Anagram Pattern Search Algorithm is O(n).Input ... Read More

Advertisements