12
Jun
After jQuery 1.2.6 and jQuery UI 1.5, I expected that some other frameworks release a new version (script.aculo.us, moo, and so on). For now, only Moo launched the final release (1.2) of their cool library. I don’t know what to say about the library (I didn’t try it yet), but this version of site is much, much nicer.
Even if I’m a jQuery addicted, I saw that MooTools have smoother animation, but their documentaion is weird (or maybe is just me, I don’t know). Anyway, in the last half year, I told myself to try Moo, but every time I give up. Maybe I will try it sometime.
10
May
Some time ago i searched for a way to limit elements on a sortable box (i used jQuery Interface). For example, i had two boxes and one of them needs no more than three items. After i searched and switch net upside down, i ask directly to the creator or Interface and he gave me a simple (but still efficient) solution:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| $('.sort').Sortable({
accept : 'sortItem',
activeclass : 'sortableactive',
hoverclass : 'sortablehover',
helperclass : 'sorthelper',
opacity: 0.5,
fit : false,
floats: true,
onStart: function(){
console.log($('#big .sortItem').size())
if ($('#big .sortItem').size() == 3) { //max of items
console.log($('#big').get(0).dropCfg.a)
$('#big').get(0).dropCfg.a = 'dummyRandom';
} else {
$('#big').get(0).dropCfg.a = 'sortItem';
}
}
}); |
Demo here (click!).