WordPress.org

Ready to get started?Download WordPress

Forums

Image change (1 post)

  1. obidos
    Member
    Posted 1 year ago #

    Hi all,

    I have a code question for you. I am lost with the answer so I hope someone can direct me.

    Basically I have a wordpress site under development and I have created two custom image sizes within my functions file.

    I am calling these images and a row of thumbnails and then above them is a larger box which I need a larger version of the thumbnail to show once the thumbnail is clicked.

    I have this working at the moment by forcing a hard crop and changing the file names by the size WordPress adds to the end of the image name:-

    $('#thumbs img').live('click', function(){
    		$('#largeImage').attr('src',$(this).attr('src').replace('46x57','199x319'));
    		$('#largeImageWindow').attr('src',$(this).attr('src').replace('46x57','398x500'));
     $('#description').html($(this).attr('alt'));
    });

    However I don't want the image to be cropped! thus the height of the image is changeable when wordpress saves it.

    How can I get the function to work with variable height images?

    Thank you kind people,

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags