Skip to content

Instantly share code, notes, and snippets.

@bibhas
Created June 29, 2010 09:28
Show Gist options
  • Save bibhas/457012 to your computer and use it in GitHub Desktop.
Save bibhas/457012 to your computer and use it in GitHub Desktop.
var r = Raphael(0, 0, 400, 600),
aRect = r.rect(10, 10, 100, 100),
aPath = r.path('M10,200 l100,0 l0,100 l-100,0 z'),
aText = r.text(200, 150, "Double click on the boxes to see what I mean.");
aRect.attr({'fill':'url("http://commondatastorage.googleapis.com/proto4/beltpattern4.png")'});
aPath.attr({'fill':'url("http://commondatastorage.googleapis.com/proto4/beltpattern4.png")'});
aRect.dblclick(function() {
this.animate({'translation':"100, 0"}, 1000);
});
aPath.dblclick(function() {
this.animate({'translation':"100, 0"}, 1000);
});
// Issue: Pattern applied on the path doesn't translate with the path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment