I am using http://jaukia.github.io/zoomooz/ to zoom elements on my web page.
However when I am adding elements dynamically through .append()
, the elements don't zoom.
I tired using .on
and doing stuff manually with no success.
$(document).on("click", ".lot", function () {
$(this).zoomTarget();
});
This is my HTML
<div class="zoomViewport">
<div class="lotmap zoomContainer">
</div></div>
Any elements added in the div class="zoomViewport"
with data attribute data-targetsize="0.05"
and class zoomTarget
would be zoomed when clicked.
Example: <img class="zoomTarget lot" data-targetsize="0.05" src="../images/sold.png"/>
I am appending elements to lotmap
.
Any help would be appreciated.
EDIT: The event is firing but I need the plugin events to work as it used to before adding elements dynamically.