Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

flash input js

/**
 * Fait clignoter un champ input pour attirer l'attention sur celui - ci
 * 
 * It takes a CSS selector, a time in milliseconds, a border color and a background color, and then
 * flashes the border and background of the element selected by the CSS selector
 * 
 * @param string selecteur_css 
 * @param int time temps en milliseconde du clignotement 
 * @param string borderColor couleur que va prendre la bordure lors du clignotement 
 * @param string backgroundColor couleur que va prendre la background lors du clignotement
 */

function input_flash(selecteur_css , time = 150 , borderColor = "red" , backgroundColor = "yellow" ){

    let input = document.querySelector(selecteur_css);

    let borderColorOrigine      = input.style.borderColor;
    let backgroundColorOrigine  = input.style.backgroundColor;

    input.style.borderColor     = borderColor;
    input.style.backgroundColor = backgroundColor;

  setTimeout(() => {     
        input.style.borderColor     = borderColorOrigine;
        input.style.backgroundColor = backgroundColorOrigine;
    }, time);
}
Comment

flash input js

/**
 * Fait clignoter un champ input pour attirer l'attention sur celui - ci
 * 
 * It takes a CSS selector, a time in milliseconds, a border color and a background color, and then
 * flashes the border and background of the element selected by the CSS selector
 * 
 * @param string selecteur_css 
 * @param int time temps en milliseconde du clignotement 
 * @param string borderColor couleur que va prendre la bordure lors du clignotement 
 * @param string backgroundColor couleur que va prendre la background lors du clignotement
 */

function input_flash(selecteur_css , time = 150 , borderColor = "red" , backgroundColor = "yellow" ){

    let input = document.querySelector(selecteur_css);

    let borderColorOrigine      = input.style.borderColor;
    let backgroundColorOrigine  = input.style.backgroundColor;

    input.style.borderColor     = borderColor;
    input.style.backgroundColor = backgroundColor;

  setTimeout(() => {     
        input.style.borderColor     = borderColorOrigine;
        input.style.backgroundColor = backgroundColorOrigine;
    }, time);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: moment format date dd/mm/yyyy 
Javascript :: view engine setup express 
Javascript :: react native status bar color 
Javascript :: javascript check uncheck checkbox 
Javascript :: js queryselector names 
Javascript :: fatal no configured push destination 
Javascript :: swap two numbers without temp in javascript 
Javascript :: react-redux imports 
Javascript :: discord.js kick user 
Javascript :: javascript regex for firstname 
Javascript :: open url in new tab javascript 
Javascript :: how to create round image in react native 
Javascript :: show and hide div tag based on checkbox selection using jquery 
Javascript :: fullscreen electron 
Javascript :: cypress set viewport 
Javascript :: jquery get iframe content 
Javascript :: python json dump to file 
Javascript :: parseint array javascript 
Javascript :: remove decimals javascript 
Javascript :: using material ui icons in react 
Javascript :: jquery for table Show entries 
Javascript :: select2 disable search 
Javascript :: unsafe value used in a resource URL context 
Javascript :: check if element is hidden jquery 
Javascript :: pagecontrol 
Javascript :: how to validate file extension in javascript 
Javascript :: nodejs server fetch is not defined 
Javascript :: redirect is not defined react/jsx-no-undef 
Javascript :: mongodb delete user 
Javascript :: check textbox is empty in jquery 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =