CSS – Responsive Image Resizing Technique
img.scale-with-grid { width: 100%; height: auto; } |
jQuery – Loop thro DOM table rows
var rows = $('.data-table-theme tbody tr'); $(rows).each(function(i, tr) { }); |
jQuery – To determine if an element is visible or not
if ($("#sbox").is(':visible') == false) { ... } |
jQuery – Animate Width on Hover
$("#sbox").animate({width: 'toggle'},300,'linear'); |
jQuery – Scroll to Top
$('html,body').animate({scrollTop: 0},1500,'easeOutCubic'); |
jQuery – Determine page scrolled length
$(window).scroll(function() { var y_scroll_pos = window.pageYOffset; var scroll_pos_test = 250; if(y_scroll_pos > scroll_pos_test) { $('nav ul li ul').hide(); } }); |
PHP – Get previous month (Dateadd “m” -1)
echo date("m-Y", strtotime("-1 month")); $x = strtotime('25-'.$_POST['xdate']); echo date("m-Y", strtotime("-1 month",$x)); |
PHP – Truncate Last Characters
substr_replace($string ,"",-1); |
Discussion