Auto image alt with image title

$(“img”).each(function() { var img_src = jQuery(this).attr(‘src’); if (typeof img_src !== typeof undefined && img_src !== false) { var img_alt = jQuery(this).attr(‘alt’); var str = img_src var pieces =...

Touche echap

$(document).on(‘keydown’, function(event) { if (event.key == “Escape”) { $(‘.popup-ptf-close’).click(); } });

Browser detection

var sBrowser, sUsrAg = navigator.userAgent; // The order matters here, and this may report false positives for unlisted browsers. if (sUsrAg.indexOf(“Firefox”) > -1) { sBrowser = “Mozilla Firefox”; // “Mozilla/5.0 (X11; Ubuntu; Linux...

Detect Mobile

if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) ||...