O'Reilly logo

AdvancED DOM Scripting: Dynamic Web Design Techniques by Aaron Gustafson, Jeffrey Sambells

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Case Study: A Photo Cropping and Resizing Tool

Now that you have several new methods in your ADS library, let's create the beginnings of a nice WYSIWYG tool that will allow you to crop and resize photos. Before you get too excited, I should mention that it's not actually possible to crop and resize a photo with your DOM script. The complete tool will require you to write a server-side portion capable of resizing the actual image file. Here, you'll simulate the cropping and resizing actions in the browser so that once it looks the way you want, you can submit the new information to the server and do the actual modifications. This chapter will set up the tool with the basic functionality you'll need and will resemble Figure 6-1.

Figure 6-1. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required