mjcoder
mjcoder

Reputation: 1011

jQuery on click replace image IE9 Bug

in IE9 only i have small images and when the user clicks this it shows the small image in the above div that is a larger size so you can see the full image - it works in all browsers apart from IE9 and i dont know what else i can do to sort this out - is it a caching issue? css issue? script issue?

<script type="text/javascript">
$(document).ready(function () {
    // image swap on the events template
    var $MainLargeImage = $('.control.Event .RightSide .Images .LargeImage');
    var $ThumbnailImages = $('.control.Event .RightSide .Images .smallImages img.SmallImage');

    $ThumbnailImages.click(function () {
        $MainLargeImage.attr('src', $(this).attr('src'));
    });
});
</script>

You can see the problem here: http://team-spirit.co.uk/events/library/A-Taste-Of-Vegas.aspx

Upvotes: 3

Views: 231

Answers (1)

Jimmery
Jimmery

Reputation: 10119

Can you try this, and let me know what the console.log's generate?

$ThumbnailImages.on('click',function () {

    console.log(this);
    var src=$(this).prop('src');
    console.log(src);
    console.log($MainLargeImage.prop('src'));
    $MainLargeImage.prop('src', src);
    console.log($MainLargeImage.prop('src'));

});

Upvotes: 2

Related Questions