JQuery enlarge image

I am using an image scaling jQuery script in my page. It works great when I have to show one image, but of course it doesn't work when I have 3 different images injected into my stamp. I want to know how I can change my script so I can use the referenced jQuery script multiple times in my page.

html and the script binding looks like this

<div id="zoomcontainer">
<div class="zoomapp" id="zoomapp"> <img id="imgRecord" class="jqzoom" src="/demo-image.jpg"/>
 <div id="zoomerNav"> <a id="btn_up" href="#"></a> <a id="btn_dn" href="#"></a> <a id="btn_left" href="#"></a> <a id="btn_right" href="#"></a> <a id="btn_plus" href="#"></a> <a id="btn_minus" href="#"></a> <a id="btn_home" href="#"></a> </div>
    </div>

    <script type="text/javascript">
                        $(function () {
                            $('#imgRecord')
                        .grViewer({ zoomLimit: 2, renderScale: 0.5 })
                        .bind('load', function () { $('#zoomapp').css('background', $('#zoomapp').css('backgroundColor')); });
                        });
                    </script>

      

+3


source to share


1 answer


Maybe this helps:



$(function () {
    $('.imgRecord').each(function(){
        $(this)
            .grViewer({ zoomLimit: 2, renderScale: 0.5 })
            .bind('load', function () { $('#zoomapp').css('background', $('#zoomapp').css('backgroundColor')); }); 
    });
});

      

0


source







All Articles