Wednesday, October 9, 2013
Thursday, October 3, 2013
Browser specific hack
Chrome Hack only
@media screen and (-webkit-min-device-pixel-ratio:0) { .ar #form-wrapper { width: 330px; } }Firefox Hack only
@-moz-document url-prefix() { .submit_btn { padding-bottom: 5px; } }IE8 Hack
@media screen { .item { background: #000; } }IE9 Hack
:root #nav li.last-page-item a { padding-right:8px\9; }coloe:red\9; hack works on IE9
Wednesday, September 25, 2013
CSS3 Background-size
CSS3
html{ background-image: url(http://coastsidefishingclub.com/site/wp-content/themes/csf/images/bg-img.jpg); background-repeat:no-repeat; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }
Wednesday, September 4, 2013
keypress uppercase jquery
Jquery
$("#ctag").bind('keyup', function (e) { if (e.which >= 97 && e.which <= 122) { var newKey = e.which - 32; e.keyCode = newKey; e.charCode = newKey; } $("#ctag").val(($("#ctag").val()).toUpperCase()); });Monday, August 26, 2013
jQuery add class based on page URL
Jquery
$(function(){ function stripTrailingSlash(str) { if(str.substr(-1) == '/') { return str.substr(0, str.length - 1); } return str; } var url = window.location.pathname; var activePage = stripTrailingSlash(url); $('#left-nav ul li a').each(function(){ var currentPage = stripTrailingSlash($(this).attr('href')); if (activePage == currentPage) { $(this).addClass('active'); } }); });Wednesday, August 21, 2013
Target only Safari and Chrome with CSS
CSS
@media screen and (-webkit-min-device-pixel-ratio:0) {#title {
color: red !important;
}
}
Friday, August 16, 2013
set margin for span tag
CSS
display:inline-blockspan is an inline element, not a block element, and they don't respect margin. You can use padding or make the span display:inline-block; and then use margins.
Subscribe to:
Posts (Atom)
Javascript find highest and lowest from the given inputs
function highAndLow(numbers){ // numbers = "4 5 29 54 4 0 -214 542 -64 1 -3 6 -6" let numbersInArr = numbers.split(' ...
-
----------HTML---------------- * Expiration - Select - Jan Feb Mar Apr May June July Aug Sep Oct Nov Dec - Select - 2011 20...
-
$("#strPhone").keydown(function(event) { if ( event.keyCode == 46 || event.keyCode == 8 ) { } else { if (event.keyCode 57 ) ...
-
Phone Number: ------------Jquery------------------- $('#txtboxID').keyup(function () { var val = this.value.replace(/\D/g, ...