Skip to content

Commit de457ac

Browse files
committed
tweaking accordion
1 parent 42c562d commit de457ac

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
2+
www
23

34
# patch
45
*.rej

src/accordion/accordion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
}
110110

111111
$.fn.accordion = function(conf) {
112-
return $.tools.create(this, "accordion", Tool, CONF, conf);
112+
return $.tools.create(this, "accordion", Tool, CONF, conf, "Select");
113113
};
114114

115115
})(jQuery);

test/accordion/accordion.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,22 @@
2121
<div class="pane4"></div>
2222
</div>
2323

24-
2524
<script>
25+
/*
26+
custom easing called "custom"
27+
http://gsgd.co.uk/sandbox/jquery/easing/
28+
http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js
29+
*/
30+
$.easing.custom = function (x, t, b, c, d) {
31+
// return -c * ((t=t/d-1)*t*t*t - 1) + b;
32+
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
33+
}
34+
2635
$(function() {
27-
$('.accordion').accordion({sticky: false, event: 'mouseenter'});
36+
$('.accordion').accordion({
37+
sticky: false,
38+
event: 'mouseenter',
39+
easing: 'custom'
40+
});
2841
});
2942
</script>

0 commit comments

Comments
 (0)