332 posts
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
CadenGrant says

For some reason on my new theme, in Safari on Mac the navigation is messed up a little bit..

Is there anyway to target just safari and mac so I can do conditional statements so it doesn’t mess with any other browsers?

This is the issue I’m having:

http://img132.imageshack.us/img132/8175/screenshot20110319at151.png

I also don’t have Mac so I have no way to fix this… could maybe somebody help me with this? I’d be willing to pay to get this fixed.

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

It affects Safari on Mac only, and not Safari on PC?

You can use browser sniffing in Javascript to add a class to the html or body tag. Here’s the code I use:

var userAgent = navigator.userAgent.toLowerCase();

var browser = {};

//Flags for major browsers
browser.isFirefox = /firefox/.test(userAgent);
browser.isOpera = /opera/.test(userAgent);
browser.isWebkit = /webkit/.test(userAgent);
browser.isGecko = /gecko/.test(userAgent);
browser.isSafari = /safari/.test(userAgent);
browser.isChrome = /chrome/.test(userAgent);
browser.isIE = /msie/.test(userAgent)&&!/opera/.test(userAgent);
browser.isIE6 = /msie 6/i.test(navigator.appVersion);

//Flags for mobile browsers
browser.isIphone = /(iphone|ipod)/.test(userAgent);
browser.isIpad = /ipad/.test(userAgent);
browser.isAndroid = /android/.test(userAgent);
browser.isBlackberry = /blackberry/.test(userAgent);
332 posts
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
CadenGrant says

Will that fix for Safari on Mac and not mess with PC?

I thought Safari rendered the same regardless of the OS but apparently not. On my PC it’s fine but somebody commented on it telling me it’s not working for them in Safari 5 on Mac.

364 posts Onuro
  • Has referred 100+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
ThemeKioken says
jQuery(function(){

  var ua = $.browser;
    if ( ua.safari && ua.version.slice(0,3) > "4" ) {
      alert( "Do stuff for Safari 5" );
    }
});

Assuming you’re using jQuery for other reasons in your theme, jQuery’s $.browser selector will help :)

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

jQuery(function(){

  var ua = $.browser;
    if ( ua.safari && ua.version.slice(0,3) > "4" ) {
      alert( "Do stuff for Safari 5" );
    }
});
Assuming you’re using jQuery for other reasons in your theme, jQuery’s $.browser selector will help :)

$.browser has been deprecated as of jQuery 1.4, and it may be removed in future versions.

364 posts Onuro
  • Has referred 100+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
ThemeKioken says

As far as I know only “safari” browser variable was deprecated, since it was replaced with “webkit”. But good to know :)

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

As far as I know only “safari” browser variable was deprecated, since it was replaced with “webkit”. But good to know :)
You’re right, I was referring to the safari flag, but still $.browser isn’t recommended

http://api.jquery.com/jQuery.browser/

We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery.
364 posts Onuro
  • Has referred 100+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
ThemeKioken says


As far as I know only “safari” browser variable was deprecated, since it was replaced with “webkit”. But good to know :)
You’re right, I was referring to the safari flag, but still $.browser isn’t recommended

http://api.jquery.com/jQuery.browser/

We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery.

Ah, makes sense :)

332 posts
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
  • Elite Author: Sold more than $75,000 on Envato Market
+4 more
CadenGrant says

Anybody that has Mac and uses Safari, could you please take a look and see if the navigation is messed up for them?

The preview is here: http://cadengrant.me/themes/photorific

3229 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 4 years
+1 more
organicbee says

Anybody that has Mac and uses Safari, could you please take a look and see if the navigation is messed up for them? The preview is here: http://cadengrant.me/themes/photorific

looks fine

by
by
by
by
by
by