332 posts
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • United States
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
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
  • United States
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
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • United States
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
  • Elite Author
  • Has been a member for 6-7 years
  • Exclusive Author
  • Referred between 100 and 199 users
  • Sold between 50 000 and 100 000 dollars
  • United States
  • Bought between 10 and 49 items
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
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
  • United States
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
  • Elite Author
  • Has been a member for 6-7 years
  • Exclusive Author
  • Referred between 100 and 199 users
  • Sold between 50 000 and 100 000 dollars
  • United States
  • Bought between 10 and 49 items
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
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
  • United States
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
  • Elite Author
  • Has been a member for 6-7 years
  • Exclusive Author
  • Referred between 100 and 199 users
  • Sold between 50 000 and 100 000 dollars
  • United States
  • Bought between 10 and 49 items
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
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • United States
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

3192 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 4-5 years
  • Exclusive Author
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