This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: prettyPhoto aspect ratio issue on an iPad

#1955
Jason Bobich
Keymaster

Yeah, this is a tricky one. The way prettyPhoto does the double loop on the size with that function is weird. So our modifications to make it responsive for mobile devices work in most scenarios, but sometimes odd things happen with extraordinarily large images. You may just want to add in the default version of prettyPhoto.

You can get it here: https://raw.github.com/scaron/prettyphoto/master/js/jquery.prettyPhoto.js

Place the javascript file in your Child theme, possibly at /assets/js/ would be a good place. For clarity here, name it prettyphoto.js (but doesn’t matter what you want to name it or where you want put it).

So, let’s say now you’ve got the new file located in your Child theme like this:

/assets/js/prettyphoto.js

Then from your Child theme’s functions.php you’d just override the theme’s version like this:

function my_scripts() {
    wp_register_script( 'prettyphoto', get_stylesheet_directory_uri() . '/assets/js/prettyphoto.js' );
}
add_action( 'wp_enqueue_scripts', 'my_scripts', 9 );

For Reference: http://dev.themeblvd.com/tutorial/overriding-a-framework-javascript-file/