问题
Take a look at what the new google calendar does when there are too many events to fit in the defined square. You can click the +2 more
link (or whatever it may say), and the square pops out a bit... and displays everything.
Does anyone know of a JS/JQuery library that has this functionality?
Example: http://i.imgur.com/86tom.png
Thanks!
回答1:
To get the pop out box, you could use a jQueryUI dialog and position it where you want it. Re-style it to match your UI, of course.
If you are also hoping to get the logic to figure out how many items are hidden, and display a "+n more..." message there, that seems like it could be a little specific for a plugin, but maybe not.
Here's one simple implementation. http://jsfiddle.net/gilly3/sxGSr/ There's a bit of hard-coding that could be made more dynamic, but this may give you a start.
来源:https://stackoverflow.com/questions/7604301/new-google-calendar-pop-out-events-if-they-dont-fit-in-the-defined-area