我想将iviewer与图片ID一起使用。有可能吗?
<script type="text/javascript">
var $ = jQuery;
$(document).ready(function(){
var iv1 = $("#viewer").iviewer({
src: "test_image.jpg", ------> here I would like to put image id. "#image_1"
update_on_resize: false,
zoom_animation: false,
mousewheel: true,
onMouseMove: function(ev, coords) { },
onStartDrag: function(ev, coords) { return false; }, //this image will not be dragged
onDrag: function(ev, coords) { }
});
});
</script>
<div id="viewer" class="viewer">
<img src="test_image.jpg" id="image_1"/>
</div>
答案 0 :(得分:0)
尝试使用它:
src: $("#viewer").find('img').attr('id') + ".jpg"