Ajax Updates |
Posted: 16 Sep 2009 09:59 AM PDT A neat looking Dashboard/Desktop. You guys are gonna totally FLIP when you hear what’s in this jam packed tutorial! More focus on the Dashboard (I swear it’s cooler than it sounds, and requires a lot of code), and I’ll even go into how to create a stack (seperate from the dock, sorry jqDock doesn’t like nestled
Preface As with the previous tutorial, I must note this disclaimer! I don’t own any of the images used in this tutorial, nor do you. They are copyright to their vendors, whether it be Apple, inc, Adobe, etc. Using icons is a bit of an integrity issue, so don’t abuse it! Secondly, a new jQuery.UI file will replace the draggable js file. This is basically all the interaction packs. Download jQuery.UI code. You’ll also need the final product of last week’s tutorial! Make sure you expand that into it’s own directory! We’ll be adding onto that. A whole lot if images are needed too. New Images. Make sure you expand that zip into the ‘images’ directory, so that any new folders are merged with their counter parts from last week. I apologise for the confusion with this. Stupid file structure, my bad. So. Files that need adding: * jQuery.ui package Just the same, the jQuery.ui links need editing. Plan of Attack Though it might not look like it, a whole lot of code is needed for these few things: 1. Stacks Changes Just before we start, I really do apologise, but there were a few things that needed changing from last week. the #dock css should read: The #closeZone’s zIndex in dashboard.js on line 24 should be 99 not 9999 So lets dive right into it, and start with Stacks. Or more a Stack. Unfortunately due to the way that jqDock works, it’s impossible to nestle stacks within the jqDock without editing the core js, which is much further than this tutorial intends. So instead, we’ll be creating a stack to the bottom right of the page. The harder parts of coding stacks is a) the incrementing height for each item, and the curve. Luckily, a loop combined with maths can do this hard work for us. Lets begin with adding the HTML structure of the stack. Now due to the nature of the stack, if you wish to use it on a different website, you can! Basically anything inline within the < li >s work. The positioning just needs tweaking. Regardless, we use spans (and you could always wrap the images in < a >. Contrary to the first tutorial, I’m going to include the CSS and jQuery for each step, just so the design doesn’t muddle up completely. Open up style.css from last week and add to the bottom:
.stack ul{ .stack ul li{ .stack ul li span{ /*I'm for the jquery*/ In plain english, the stack needs to open when the img is clicked, pushing each (hint…) li up in incrememnts, and to the right a little, whilst resizing to a smaller size. Then when clicked again, everything returns to normal. }, function(){ }); Top incrementing is the same each time, where as unless you want a horizontal straight line, each horizontal position has to be slightly more than the rest. In this case, it increases by the previous number plus one, times 2. so it’ll go 2, 6, 14, 30, 62, 126, etc. I know they’re weird numbers, but it works. Use any equation you like! The ‘each’ function is similar to, say a WordPress loop. This function happens every time the next element is used. The equation ‘value = (value+1)*2′, means ‘new value equals old value plus one, then this times two. The first animate line adds the variables (within the plus) every time it’s looped via string splitting. The last two lines are just the size. The other half of the toggle function, just resets everything back to normal:
Related Listings:
| |||||
Photo Effects using jQuery Plugin Posted: 16 Sep 2009 09:11 AM PDT This is a class inspired by http://www.netzgesta.de/cvi/ and their great http://www.netzgesta.de/instant/ instant.js class of images being little rotated. This class uses excanvas – google implementation that solves problem with canvas in IE. In future versions I planing little animation on mouseover/mouseout. Use: Just put Wilq32.PhotoEffect into your class in your image: Parameters: Wilq32.PhotoEffects(width,height,angle) - width – width of border Known Bugs: around image in Internet Explorer makes unproper behaviour, to solve this put image in if you plan to use around your img. Related Listings:
|
You are subscribed to email updates from Ajax Updates To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.