diff --git a/resp_img.js b/resp_img.js
index 68d4430..d377876 100644
--- a/resp_img.js
+++ b/resp_img.js
@@ -97,7 +97,12 @@
         var img = $(this);
         var orig_src = img.attr('src');
         if (typeof orig_src !== 'undefined') {
-          var src = orig_src.replace(current_suffix, suffix);
+          if (Drupal.settings.respImg.newUrls && Drupal.settings.respImg.newUrls[orig_src] && Drupal.settings.respImg.newUrls[orig_src][suffix]) {
+            var src = Drupal.settings.respImg.newUrls[orig_src][suffix];
+          }
+          else {
+            var src = orig_src.replace(current_suffix, suffix);
+          }
           img.attr('src', src);
         }
         img.removeAttr('width');
diff --git a/resp_img.module b/resp_img.module
index d8e5372..f7ddab5 100644
--- a/resp_img.module
+++ b/resp_img.module
@@ -215,6 +215,13 @@ function resp_img_theme_registry_alter(&$theme_registry) {
         $theme_registry[$key]['preprocess functions'] = array('resp_img_pp_image');
       }
     }
+    if ($key == 'image_style') {
+      if (isset($theme_registry[$key]['preprocess functions']) && is_array($theme_registry[$key]['preprocess functions'])) {
+        array_unshift($theme_registry[$key]['preprocess functions'], 'resp_img_pp_image_style');
+      } else {
+        $theme_registry[$key]['preprocess functions'] = array('resp_img_pp_image_style');
+      }
+    }
     if ($key == 'field_slideshow') {
       if (isset($theme_registry[$key]['preprocess functions']) && is_array($theme_registry[$key]['preprocess functions'])) {
         array_unshift($theme_registry[$key]['preprocess functions'], 'resp_img_pp_field_slideshow');
@@ -248,13 +255,30 @@ function resp_img_pp_field_slideshow(&$variables) {
  */
 function resp_img_pp_image(&$variables) {
   resp_img_add_js();
+}
+
+/**
+ * Support for image styles.
+ */
+function resp_img_pp_image_style(&$variables) {
+  resp_img_add_js();
   if (isset($variables['style_name']) && $variables['style_name'] != resp_img_replace_suffix($variables['style_name'])) {
     $variables['style_name'] = resp_img_replace_suffix($variables['style_name']);
-    $variables['path'] = resp_img_replace_suffix($variables['path']);
-    foreach (array('width', 'height') as $key) {
-      if (isset($variables[$key])) {
-        unset($variables[$key]);
-      }
+    // Add JavaScript settings for all possible suffixes for this image.
+    $settings = array();
+    $best_suffix = resp_img_get_best_suffix();
+    $image_url = image_style_url($variables['style_name'], $variables['path']);
+    foreach (array_keys(resp_img_suffix_load_all_breakpoints()) as $suffix) {
+      $style_name = str_replace($best_suffix, $suffix, $variables['style_name']);
+      // Suppress this module's altering of URLs before calling
+      // image_style_url(), since we want to know the real URL associated with
+      // the requested image style.
+      resp_image_suppress_file_url_alter(TRUE);
+      $settings['newUrls'][$image_url][$suffix] = image_style_url($style_name, $variables['path']);
+      resp_image_suppress_file_url_alter(FALSE);
+    }
+    if ($settings) {
+      drupal_add_js(array('respImg' => $settings), array('type' => 'setting', 'weight' => -11, 'group' => JS_DEFAULT));
     }
   }
 }
@@ -272,7 +296,22 @@ function resp_img_url_outbound_alter(&$path, &$options, $original_path) {
  * Alter all image sources.
  */
 function resp_img_file_url_alter(&$uri) {
-  $uri = resp_img_replace_suffix($uri);
+  if (!resp_image_suppress_file_url_alter()) {
+    $uri = resp_img_replace_suffix($uri);
+  }
+}
+
+/**
+ * Allows the altering of file URLs to be suppressed.
+ *
+ * @see resp_img_file_url_alter()
+ */
+function resp_image_suppress_file_url_alter($suppress = NULL) {
+  static $state = FALSE;
+  if (isset($suppress)) {
+    $state = $suppress;
+  }
+  return $state;
 }
 
 /**
