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.
Thursday, March 14, 2013
onkeypress should not allow alpha charecter
Hover box with arrow - after before
Html code
div id='rectangel' /divCSS code
#rectangel{ height:40px; width:100px; background:red; } #rectangel:hover{background:blue;} #rectangel:hover:after{border-top-color: blue;} #rectangel:after{ content: ""; height:0; position: absolute; width: 0; margin-top:40px; margin-left:40px; border: 10px solid transparent; border-top-color: red; }Thursday, February 21, 2013
css3 rounded corner navigation bar
Monday, January 7, 2013
Detecting when textarea scroll has reached the bottom to enable button
body{ font:normal 13px/18px Arial, Helvetica, sans-serif; margin:0; padding:10px; } #terms { border: solid 1px; height: 350px; width: 340px; overflow: auto; margin-bottom: 1em; }
Please read these terms and conditions now. You must scroll to the bottom before continuing.
1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
2. Lorem ipsum Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
3. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
4. Lorem ipsum Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Jquery Code: -------------
$(document).ready(function(){ $('#terms').scroll(function () { if ($(this).scrollTop() == $(this)[0].scrollHeight - $(this).height()) { $('#register').removeAttr('disabled'); } }); });
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(' ...
-
function highAndLow(numbers){ // numbers = "4 5 29 54 4 0 -214 542 -64 1 -3 6 -6" let numbersInArr = numbers.split(' ...
-
HTML Jquery $("#num").keypress(function (e){ var charCode = (e.which) ? e.which : e.keyCode; if (charCode > 31 ...
-
//Change the port connect: { options: { port: 8080 , // change this to '0.0.0.0' to a...