").addClass("tooltip").appendTo(document.body),
title;
$("a[title]")`.mouseenter(`function(event) {
title = this.title;
this.title = "";
tooltip.text(title).css({
left: event.pageX + 10,
top: event.pageY + 10
})
`.addClass("tooltip-visible");`
})`.mouseleave(`function() {
this.title = title;
`tooltip.removeClass("tooltip-visible");`
});
CSS transitions: declarative or not?
Matter of preference, control and fallbacks
Fallback to jQuery animations
For supported properties
Animated page scroll demo
Animated page scroll
Animated page scroll
5. Customize widgets like customizing a car
Flick theme, original CSS
Flick theme, custom CSS
Options for CSS customization
- ThemeRoller
- Overrides
- Use structure.css, write theme from scratch
- Everything from scratch
Quiz Time Answer
What is the most popular jQuery version on the jQuery CDN?
- jquery-1.9.1.min.js, #1, 1553m hits, 45 TB
- jquery-1.7.2.min.js, #2, 1451m hits, 56 TB
- jquery-1.10.2.min.js, #4, 1146m hits, 37 TB
- jquery-1.4.2.min.js, #15, 22m hits, 0.5 TB
1. Write code like you spend fuel
plan ahead, spend as necessary, keep a reserve
2. Write code like you don't know the road
be flexible, avoid brittle methods and selectors
3. Write code like you avoid traffic jams
avoid JavaScript rush hours, use a profiler when you run into unexpected bottlenecks
4. Combine tools like you'd park and ride
make use of CSS transitions, combine with jQuery
5. Customize widgets like customizing a car
don't build widgets from scratch when you can adjust them to your needs