Jump to content
Sign in to follow this  
chroniquemusicale

Bug in safari when turn the phone

Recommended Posts

chroniquemusicale

The site appears correctly, but when we turn the iphone (from vertical to horizontal or vice and versa), Safari freezes. The theme uses is Platform Pro. Last version. Do you have any idea?

Share this post


Link to post
Share on other sites
cmunns

Hmmm...it seems to happen ONLY when the orientation changes regardless of start position. If you have a basic page without a carousel or any heavy js does it work then?

Share this post


Link to post
Share on other sites
chroniquemusicale

You are right. Without the carroussel it works fine.

Share this post


Link to post
Share on other sites
chroniquemusicale

For your information. This bug (safari freeze) does not appear on a safari in an iPad. (even if the caroussel does not work propely in an iPad).

Share this post


Link to post
Share on other sites
Simon

Why not disable the carousel for the iphone?

Share this post


Link to post
Share on other sites
chroniquemusicale

Yes, how to do it only for iPhone?

Share this post


Link to post
Share on other sites
Simon

Pretty easy actually. add this to platformbase functions.php

		add_filter('body_class','browser_body_class');
		function browser_body_class($classes) {
			global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
	
			if($is_lynx) $classes[] = 'lynx';
			elseif($is_gecko) $classes[] = 'gecko';
			elseif($is_opera) $classes[] = 'opera';
			elseif($is_NS4) $classes[] = 'ns4';
			elseif($is_safari) $classes[] = 'safari';
			elseif($is_chrome) $classes[] = 'chrome';
			elseif($is_IE) $classes[] = 'ie';
			else $classes[] = 'unknown';
	
			if($is_iphone) $classes[] = 'iphone';
			return $classes;
		}
	

Now reload your page, look at the HTML source, the body tag will have the browser model too! So you can now target the iphone with css class .iphone and hid the carousel.

Share this post


Link to post
Share on other sites
chroniquemusicale

ok, I had your code on the functions.php and add .iphone #carousel { display:none; } on the css rules and the carousel is no more display on iPhone and iPad. And safari will not freeze anymore. Thanks a lot.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×