Nested Sortables
Summary
Testing to see if I can have many levels of inter-list sorting with the jQuery UI. I can!

jQuery Font Size Animate
Summary
Just testing to see if jQuery can animate font size. It can!

Notes
The actual animation only requires the .animate({fontSize: "(size)px"},duration); line, but I added more code like callbacks so the button can work more than once.
Reusable Calendar Project Update 4
Summary
Added the pre-Oct 1582 restriction on the reusable calendar. (Working version, Update 4 version)

Essentially, the addition from Update 3 is the function checkRestraint(), where it checks the date being dragged or clicked on to see if it should be set to Oct 1582 or let it be.
I also used the checkRestraint() function to make the cursor look normal when the mouse is over a date that should not be available, even though they can click on it, but it would just move to Oct 1582.
Check it out and let me know if it the functions don’t work properly or intuitively.
Read the rest of this entry »
Calendar Strips Drag on a Grid
Summary
I isolated the dragging portion of update 3 of the reusable calendar project to show what options under the draggable jQuery UI to use.

In the draggable() function, I used the grid: [0, 15] to restrict its movement to 15 px vertical, then I used containment: [0, y1, 0, y2], where y1 is the offsetTop value of the strip itself when it’s at the last month/digit, and y2 is at the first month/digit, to restrict its range so the strip won’t go past the first and last value.
Reusable Calendar Project Update 3
Summary
Adding more functionalities to the date display to the reusable calendar. Now you can click on the months or year digits, or you can drag the strips to change the date. (Before, you can only click on the arrows move forward or backward one month at a time.)

This dragging function was made easily possible by the jQuery UI. It takes a lot of the grunt work out of the process.
Notes
The current range is Jan 1000 to Dec 9999. But technically, the calendar doesn’t apply before October 15, 1582, since that’s when the Gregorian calendar was first adopted. So I will add that restriction in the next or upcoming updates.
Reusable Calendar Project Update 2
Summary
A work-in-progress update of the reusable calendar project I introduced last time where the frame that goes around the dates of the month moves instead having a different layout for each month.
In this update, the basic functions are added to the arrows. When the arrows are clicked, the script updates the new month and year in the background and updates the date display and calendar frame and cross-outs strips with jQuery animation.
Currently, the calendar can only move by pressing the arrows, month by month. The next stage will involve the ability to click on the month and year digits to jump to a different month, year, decade, century, or millennium.
Notes
I didn’t think the project would work so smoothly so far. I guess a lot of planning and thinking ahead pays off. But the next stage might be a bit tricky, since there will probably be a lot more things to manage with the individual month and year digits being clickable.
You may see the ongoing version that changes and is added upon as time goes on.
Reusable Calendar Project Update 1
I mentioned in my latest monthly update on Flush that I am working on a special calendar that I will hopefully display on the home page of the website when it’s all done. Here is a screenshot of the basic set up I have so far:

It might look a bit complicated, but the concept is delightfully simple (to me at least). I will probably explain more in detail later on, but basically, the idea is that with the set up on the left, you can generate any layout of the month we see in practically all calendars in the world.
jQuery UI Drag/Drop Basics
Summary
Moving into the jQuery UI section and testing the dragging and dropping functions.

Notes
Notice in the demo that the box on the right is set to float:right, so if you supposedly dropped the green box into it, and change your window width, the green (turned light grey) box stays at the same place while the right box moves to the left. Got to fix that experience in future, more complex versions.
Slideshow with Controls
Summary
A continuation of the previous slideshow demo but with controls to play, stop, advances, and select slides.

Notes
The images in this demo stack one on top of another from 1 to 9, which is why the top image starts with 9 and plays down to 8, 7, 6, etc.
Simple No Control Slideshow
Summary
Using jQuery to rotate image order in a slidehow instead of using Flash.
This is a work in progress where in future versions, the slideshow will include controls.
Notes
- The Helper PHP File in the code is the packaged version of Displaying Images from a Directory, which I just demo’d in the previous post.
- This demo intentionally displays the images slightly off one another’s placement position to show how the ordering works.
List Index
Summary
I used this function technique for both the main navigation and experiments navigation for this site to determine which item is being hovered so I can tell where the navigation strip to move to. I’m still learning jQuery so the exact syntax to determine the index of an item from a list or of any group is bit tricky.