资源说明:A very easy to use, cross platform, jQuery based UI toolkit, that's still small in size, has the features you need, and doesn't get in your way of doing things!
jQuery-jKit =========== A very easy to use, cross platform, jQuery based UI toolkit, that's still small in size, has the features you need, and doesn't get in your way of doing things! Full Documentation ------------------ Get the full documentation over here: [jquery-jkit.com](http://jquery-jkit.com/) Basics ------ ###Including the library ###Basic Usage (HTML) jKit uses the the "data-jkit" attribute to inject it's functionality into your html. If you don't want, you don't have to use JavaScript, at all! data-jkit="[slideshow:interval=4000;speed=250;animation=fade]" Let's have a closer look at what's inside the attribute: data-jkit="[command:option=value;anotheroption=anothervalue][anothercommand]" The first thing is always the jKit command that you want to execute. In the first example we used the slideshow command. If you don't want to use your own command options, than that's all you have to do. If you want to use your own options, than add a doublepoint followed by your options like this: data-jkit="[command:option1=value1;option2=value2;option3=value3]" In most cases you add just one command to a HTML element, but sometimes you want to add more, and that's exactly why we have the brackets! Here's an example with two commands: data-jkit="[split:container=span][cycle:what=css.color;where=span;sequence=,,,#f30]" Here's a complete example with the random command. Inside a div element we have four paragraphs and want to only show three of them, randomly chosen:And to illustrate two commands on one single element, we create a slideshow from those three randomly selected paragraphs:Text 1
Text 2
Text 3
Text 4
It's that easy! You can even have jKit stuff inside jKit stuff as in the following example where we put lorem ipsum text into the paragraphs:Text 1
Text 2
Text 3
Text 4
If you want you can put spaces and even linebreaks between the options to make it more readable, for example like this:In one of our tests, we put a slideshow into a tab navigation, into an accordion, into another accordion and a last accordion. It worked great! In our first versions of jKit, we abused the rel attribute to execute the commands, you can still do that, but we think you should better use the HTML 5 doctype together with the data-jkit attribute. Anyway, if you really want to use the rel attribute, here's how: ###Basic Usage (JavaScript) You can execute all jKit commands with JavaScript, too. This is not the prefered way, but sometimes you have to do it and this is how: $('#someElement').jKit('yourCommand', { 'option1': value1, 'option2': 'value2' }); ADVANCED -------- There's a lot of cool stuff under the hood of jKit for advanced users. Here's how to get most out of jKit. ###Macros Macros can make your life a lot easier if you need to use the same command and options more than once. There are two ways to define a macro, the first one is on plugin init: You can than use them like this:...The second way to define a macro is with the macro command: [macro:name=hoverhide] It creates a macro from the previously used command on the same element. Here's a real example to get a better idea of how the macro command works: When using a macro, it is possible to overwrite any of the options defined in the macro. Here's an example: One last warning! If you name a macro the same as a built in command, you will overwrite that command, so please be carefull and give your macros unique names! ###Easing Plugin All commands that use animations have an option called "easing". To get all the great easing options, you have to include this amazing easing plugin on your page (or some other easing plugin that may be around somewhere). ###Dynamic Option Values jKit makes it possible to use dynamic option values by adding the "*" character to the end of the value. You can either use global variables or global functions. Here's an example where we limit the length of a string to the number stored in a global variable. 1234567890123456789012345678901234567890123456789 Here's how you would do the same thing using a global function: The second way is of course only usefull in case you don't want to return the same value each time. And because "this" inside the function is the current element, you can actually do some very cool stuff with it. ###The Target Option The target option is a special option that's available on all commands. It allows you to target childrens of the current element, so it's very usefull for stuff where you need to apply the same command to multiple elements. Here's an example where we limit the character count for every li element:
- jkdhfajksdf fdsjafhkj fkha jkdfajkslhf jkshjhl
- jdhj ghs fdsgh jdsjg dflshg jfdghsjk jfdsjg
- dfjhdjsh dfjks fgjg dsjgdfs
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。