words

Target Safari on WindowsSafari detektálása Windowson

Here’s a working example how to detect Safari on Windows and apply a css class to the body element:

(function($){
	if (navigator.userAgent.indexOf('Safari') != -1 
	&& navigator.userAgent.indexOf('Mac') == -1
	&& navigator.userAgent.indexOf('Chrome') == -1) {
		$('body').addClass('safari-win');
	}
})(jQuery);

You will probably need this snippet to solve font related issues in Safari (on Windows).Egy egyszerű példa, hogyan tudod detektálni a Windows-on futó Safarit:

(function($){
	if (navigator.userAgent.indexOf('Safari') != -1 
	&& navigator.userAgent.indexOf('Mac') == -1
	&& navigator.userAgent.indexOf('Chrome') == -1) {
		$('body').addClass('safari-win');
	}
})(jQuery);

Valószínű szükséged lesz erre, ha a betűtípusokkal szenvedsz Safari/Windows kombón (pl.: inline-block whitespace).

Last updated: