Skip to content

Instantly share code, notes, and snippets.

@claus
Created June 4, 2012 13:35
Show Gist options
  • Select an option

  • Save claus/2868415 to your computer and use it in GitHub Desktop.

Select an option

Save claus/2868415 to your computer and use it in GitHub Desktop.
Load jQuery with PNGDrive
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>PNGDrive.js</title>
</head>
<body>
<p><a href="https://github.com/MadeInHaus/PNGDrive">PNGDrive on GitHub</a></p>
<script src="../lib/pngdrive-min.js"></script>
<script>
function doStuff() {
var div = $("<div>Hello World from jQuery!</div>").css("margin-left", 300).animate({"margin-left": 0}, 3000);
$("body").append(div);
}
var image = new Image();
image.src = "images/jquery-1.7.2.min.png";
image.onload = function(e) {
var pngdrive = new PNGDrive(e.target);
eval(TextDecoder('utf-8').decode(pngdrive.getFileByName("jquery-1.7.2.min.js").content));
doStuff();
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment