Reply To: Disable Retina Images

#1338
livemesh
Keymaster

If you want to do this more often, there is a lightweight script which does this for you if you do not want to write the JS code yourself –

https://github.com/leonsmith/retina-replace-js

All you need to ensure is having another image with a name suffix _2x added to the original image name and residing in the same folder. You then call the script on the targeted element like this in js/main.js file –

$('.service-box2').retinaReplace();

Pls check it out and let me know if you have questions. To include this script, pls modify the custom/custom-functions.php file and use the function call –

/* Load specific scripts for the framework. */
    add_action('wp_enqueue_scripts', 'mo_enqueue_scripts');

function mo_enqueue_scripts() {
    wp_enqueue_script('retina-replace', get_template_directory_uri() . '/js/lib/retina.replace.js');
}