Reputation: 1337
Using object.on('selected', function() {}), I can get the image object that is clicked. My intent is to redirect to an URL by clicking it. How can I add an URL to an image, or more general, to an object in Fabric.js?
Upvotes: 1
Views: 1939
Reputation: 12587
You can simply navigate to the target page in the selected
event handler:
object.on('selected', function() {
window.location.href = "http://www.example.com/";
})
Upvotes: 2