Posts

Showing posts from December, 2023

Today I have learned Toast in javascript

Image
  Toast in javascript: Add the listener on Button and this Button will show a  toast  message. btn.setOnClickListener (new View.OnClickListener () {}); 2 Now, Create a  toast  message. The  Toast .makeText () method is a pre-defined method which creates a  Toast  object. ... 3 Display the created  Toast  Message using the show () method of the  Toast  class. ... To create a toast, take two divs with the class .toast-header, .toast-body and wrap them inside a with the class .toast, also give a unique id to this div. Then use this id to connect a button with toast that will trigger the toast. This article is about Bootstrap 5 Toasts. This is how a basic toast is created.   </ div >     < div class = "toast show" >     < div class = "toast-header" >       < strong class = "me-auto" > Bootstrap </ strong >     ...

Today I have solved the problem in javascript

Image
  Given an integer array  nums , find the  subarray  with the largest sum, and return  its sum .

Today I have learned card in javascript

Image
 Card in javascript: Card format is an integral piece of material design. The detachment is frequently accomplished by using shadows, which gives the deception of profundity, or slight color contrast. It is a popular decision for news websites, magazine sites, and online journals, which are all presenting the client with ‘depictions’ of stories that they may then decide to tap on to understand more. It is likewise popular for portfolios as it permits a variety of content to be introduced at the same time, however unmistakably. So in this article, we will be discussing the Collection of Card Design which includes Flip and 3D impacts that you can use for your profile card or product card using HTML, CSS, and JavaScript where all of these JS Cards Example will be provided along with the source code. < div className = "cardcontainer" >         < div className = "cardcontainer1" >             < h1 > one </ h1 > ...

Today I have solved the problem in javascript

Image
  A message containing letters from   A-Z   can be   encoded   into numbers using the following mapping: 'A' -> "1" 'B' -> "2" ... 'Z' -> "26" To  decode  an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example,  "11106"  can be mapped into: const numDecodings =( s )   => {       const decoder = {         1 : "A" ,         2 : "B" ,         3 : "C" ,         4 : "D" ,         5 : "E" ,         6 : "F" ,         7 : "G" ,         8 : "H" ,         9 : "I" ,         10 : "J" ,         11 : "K" ,         12 : "L" ,         13 : "M" , ...

Today I have learned Modal in javascript

Image
 Modal in javascript: Modals are built with HTML, CSS, and JavaScript. They’re positioned over everything else in the document and remove scroll from the  <body>  so that modal content scrolls instead. Clicking on the modal “backdrop” will automatically close the modal. Bootstrap only supports one modal window at a time. Nested modals aren’t supported as we believe them to be poor user experiences. Modals use  position: fixed , which can sometimes be a bit particular about its rendering. Whenever possible, place your modal HTML in a top-level position to avoid potential interference from other elements. You’ll likely run into issues when nesting a  .modal  within another fixed element. Once again, due to  position: fixed , there are some caveats with using modals on mobile devices.  See our browser support docs  for details. Due to how HTML5 defines its semantics,  the  autofocus  HTML attribute  has no effect in Boo...

Today I have learned Form in javascript

Image
 Form in javascript: Form name tag is used to define the name of the form. The name of the form here is "Login_form". This name will be referenced in the JavaScript form. The action tag defines the action, and the browser will take to tackle the form when it is submitted. Here, we have taken no action. The method to take action can be either  post  or  get , which is used when the form is to be submitted to the server. Both types of methods have their own properties and rules. The input type tag defines the type of inputs we want to create in our form. Here, we have used input type as 'text', which means we will input values as text in the textbox. Net, we have taken input type as 'password' and the input value will be password. Next, we have taken input type as 'button' where on clicking, we get the value of the form and get displayed. When we submit the form, the action is taken just before the request is sent to the server. It allows us to add an ev...

Today I have solved the problem in javascript

Image
  Given an unsorted integer array   nums , return the smallest missing positive integer. You must implement an algorithm that runs in  O(n)  time and uses  O(1)  auxiliary space.

Today I have learned carousel in javascript

Image
 Carousel in javascript: An image Slider  or  Image Carousel  is an expedient way to show multiple images on a website. Alluring flashy images can draw many visitors to the site.  In this post, we will create the above image slider using  HTML ,  CSS  and  JavaScript . Let’s begin with creating the image slider.    Step – 1 : To create the structure for the image slider using HTML we will use a parent div called container and inside that div, we will insert all the images from the respective sources. Step – 2 : Once we have created the HTML structure for our image slider, the next step is to style the slider using CSS. We will add styles to the images, backgrounds etc. We will also style the dots and make our  images responsive  and browser-friendly using CSS.  Step – 3 : After adding styles to the slider, the last thing left is to use javascript to add the functionality of auto changing of images after a specific tim...