Jump to content

Adjust distance between Add button and product image


CoderJim

Recommended Posts

You will not be replacing lines of code, but rather adding back two lines of code that was removed from CC622..

This is what you will be wanting to try:

    if($('a.open-clearing img#img-preview').length) {
        $('a.open-clearing img#img-preview').load(function() {
            var ip = $('a.open-clearing img#img-preview');
            var ip_height = ip.height();
            var ip_width = ip.width();
            var min_height = ip_width * 0.7;
            if(ip_height<min_height) {
                ip_height = min_height;
            }
            $('a.open-clearing img')
               .css({
                 'min-height':ip_height+'px',
                 'max-height': ip_height+'px'
               });
        });
    }

 

Link to comment
Share on other sites

Edit: Do not do the following. This code allows for the "bounci-ness" of the main image area that we have been working to solve.

---------------------

I do not know if the following version of that code is any better, but try:

    if($('a.open-clearing img#img-preview').length) {
      $('a.open-clearing img#img-preview').load(function() {
        var ip = $('a.open-clearing img#img-preview');
        var ip_height = ip.height();
        var ip_width = ip.width();
        var min_height = ip_width * 0.7;
        if(ip_height<min_height) {
            ip_height = min_height;
        }
//        $('a.open-clearing img')
//           .css({
//             'max-height': ip_height+'px'
//           });

        $('#open-clearing-wrapper')
           .css({
             'min-height':ip_height+'px',
             'max-height': ip_height+'px'
           });

      });
    }

Here, the image's container is getting sized, but not the image itself.

Link to comment
Share on other sites

Thanks, I will give that a try before too long as I begin to tackle the call.to.action aspect and need to adjust the image size, but at the moment I am back creating content, working off my headache and am a happy camper, thank you again for all your help. I will say that the new 6.2.4 2.cubecart.js is completely different than the previous 6.2.2 version and this is going to drive me nuts when I update another one of my sites before too long, I expect I will be back for more of your wise counsel.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...