WordPress.org

Ready to get started?Download WordPress

Forums

WP Retina 2x
[resolved] Responsive Design Issue (2 posts)

  1. lkhulusi
    Member
    Posted 11 months ago #

    Hey Jordy,

    First of all, great plugin! Thanks so much for taking the time to make it.

    I noticed an issue on one of the sites I'm currently building where the @2x image actually has the width and heigh properties in the image tag. Because my site is responsive, having those attributes in the image messes with the functionality.

    I modified the code in your retina.js file as follows:

    RetinaImage.prototype.swap = function(path) {
        if (typeof path == 'undefined') path = this.path.at_2x_path;
    
        var that = this;
        function load() {
          if (! that.el.complete) {
            setTimeout(load, 5);
          } else {
            if (config.force_original_dimensions) {
              // that.el.setAttribute('width', that.el.offsetWidth);
              // that.el.setAttribute('height', that.el.offsetHeight);
            }
    
            that.el.setAttribute('src', path);
          }
        }
        load();
      }

    Do you think you might be able to create an option for the plugin so that original image sizing can be turned off for responsive designs where the developer has set up custom image sizes? I'm just worried that an update may overwrite this file in the future and I'll have to figure all this out again.

    Thanks!

    http://wordpress.org/extend/plugins/wp-retina-2x/

  2. Jordy Meow
    Member
    Plugin Author

    Posted 10 months ago #

    Actually the problem is that the client-side method uses an EXTERNAL script. Of course I could fork it and add options and all, but I prefer to concentrate on the core of the plugin, and the HTML Rewrite method (which is the only method developed 100% for WordPress).

Reply

You must log in to post.

About this Plugin

About this Topic