Monday, 22 April 2019

how Change an HTML5 input's placeholder color with CSS


now you can Change an HTML5 input's placeholder color with CSS

::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color: #909;
} :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #909;
opacity: 1;
} ::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #909;
opacity: 1;
} :-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #909;
} ::-ms-input-placeholder { /* Microsoft Edge */
color: #909;
} ::placeholder { /* Most modern browsers support this now. */
color: #909;
}

transition height: 0; to height: auto; using CSS?


transition height: 0; to height: auto; using CSS?

#menu #list {
max-height: 0;
transition: max-height 0.15s ease-out;
overflow: hidden;
background: #d5d5d5;
}

#menu:hover #list {
max-height: 500px;
transition: max-height 0.25s ease-in;
}

how CSS triangles work?


CSS triangles work?

#triangle-up {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid red;
}

vertically center text with CSS?


vertically center text with CSS?

#box {
height: 170px;
width: 270px;
background: #000;
font-size: 48px;
color: #FFF;
text-align: center;
}

change the href for a hyperlink using jQuery???


change the href for a hyperlink using jQuery???


$("a").attr("href", "http://www.google.com/")


modify the href of all hyperlinks to point to Google. For instance, if you have a mix of link source (hyperlink) and link target (a.k.a. "anchor") anchor tags:

The yahoo

How do I check if an element is hidden in jQuery?


How do I check if an element is hidden in jQuery?
// Checks css for display:[none|block], ignores visibility:[true|false] $(element).is(":visible");
// The same works with hidden
$(element).is(":hidden");

embed an SVG and change its color in CSS without using a JS-SVG framework?


embed an SVG and change its color in CSS without using a JS-SVG framework?

jQuery('img.svg').each(function(){ var $img = jQuery(this); var imgID = $img.attr('id'); var imgClass = $img.attr('class'); var imgURL = $img.attr('src'); jQuery.get(imgURL, function(data) { // Get the SVG tag, ignore the rest var $svg = jQuery(data).find('svg'); if(typeof imgID !== 'undefined') { $svg = $svg.attr('id', imgID); } if(typeof imgClass !== 'undefined') { $svg = $svg.attr('class', imgClass+' replaced-svg'); } $svg = $svg.removeAttr('xmlns:a'); $img.replaceWith($svg); }, 'xml'); }); 

remove a property from a JavaScript object?

remove a property from a JavaScript object? delete myObject.regex; // or, delete myObject['regex']; // or, var prop = ...