SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 381 | Next

Dan Wellman

"Learning the Yahoo! User Interface library"

In basket.css,
add the following new selectors and rules:
.prod {
position:relative;
height:40px;
width:250px;
padding:5px;
}
.prodTitle {
margin:11px auto auto 5px;
text-align:left;
float:left;
width:100px;
}
.prodPrice {
margin-top:15px;
width:50px;
float:left;
}
The basket should now function as we want it to within the confines of this example.
If you run the page and then drag a product into the basket, the basket should be
updated accordingly, as in in the screenshot below:
Chapter 9
[ 307 ]
Extending the DDProxy Object
Now we'll look at using the YAHOO global object's .extend() method to streamline
our code and cut down on unnecessary duplication. Instead of having to define
properties and event handlers for each DDProxy object individually, we can
customize the DDProxy object itself so that every instance of the object has them
already built in.
Here is the complete script: