Zepto 1.0.0
Party like it's one-oh!
Notable changes
- Zepto is now compatible with Twitter Bootstrap
- Portable, completely new node.js-based build system
- Fully automated tests with PhantomJS and Travis CI
- Removed
touch
module from default distribution
New features
$.fn.filter(function(index){ ... })
$.fn.contents()
$.fn.wrapInner()
$.fn.scrollTop()
$.contains()
$.fn.has()
$.fn.position()
$.fn.offsetParent()
$.parseJSON()
$.camelCase()
$.isWindow()
$.grep()
(interface toArray.filter
)- Support
$(html, attributes)
syntax for element creation - Emulate
mouseenter
andmouseleave
events - Bootstrap compat: support
$.fn.offset(coordinates)
- Bootstrap compat: implement
$.fn.detach()
- Add support for Ajax
cache: false
option - Prevent scrolling when horizontal swipe events are detected
cancelTouch
for tap eventsprev
andnext
now support an optional selector argument$.fn.find
and$.fn.closest
now support Zepto objects as arguments- Enable deep copy via
$.extend(true, target, source)
- Enable nested structures for
$.fn.wrap()
and$.fn.wrapAll()
- Enable function arguments for
$.fn.wrap()
and$.fn.wrapInner()
- Support number, boolean, JSON types in data attributes
- Support manipulating classnames on SVG elements
- Enable named durations for
animate
, e.g.slow
. - Support
timing-function
foranimate
- Support event properties passed to
$.fn.trigger()
or$.Event()
- Selector module: support child
> *
queries - Add detect support for mobile Chrome browser
- Add
$.os.phone
and$.os.tablet
(booleans) - Detect Firefox mobile, Playbooks and BB10
Fixes
- Fix passing null selector to
on
oroff
- Fixed bug where self-closing html tags would act as open tags
- Fix
val
for multiple select - Fix various touch and gesture bugs.
- Corrected parameters of
load
success callback to match jQuery. - Fix
css
with 0 values and falsy values - Fix a
css
performance issues with string values - Fix
$.ajaxJSONP
when invoked directly - Fix
animate
with 0 durations. - Fix
toggle
andfadeToggle
for multiple elements. - Fix ajax
$.fn.load
behavior with selector - Make
attr(name, null)
unset attribute - Fix
animate
in Firefox - Fix
animate
for elements just added to DOM - Fix an escaping issue with
$.param
- Respect
traditional: true
option in$.ajax
- Fix
focus
&blur
event delegation and enable unbind - Simple wrapping for any object passed to
$()
- Enable
children
method for XML documents - Don't eval
<script>
content whensrc
is present - Support
processData
option for$.ajax()
- Enable passing
contentType: false
to$.ajax()
- Apply
focus()
andblur()
to all elements in collection - Change
$.fn.map()
to return a Zepto collection - Selector argument for
on(evt, selector, fn)
can be false - Don't raise error on
$('#')
- Provide empty object in
$.support
return false
in event handler calls stopPropagation()- Fix
$.isPlainObject()
forwindow
in Opera $.ajax
error callback correctly reportsabort
status- Fix
hasClass
in collections of multiple elements - Stop iteration in
each()
when the callback returns false - Add ability to set
xhr
factory per-request - Have
get()
method accept negative index - Support for multiple class names in
toggleClass()
- Fix error callbacks for
ajaxJSONP
- Support optional
data
argument for various Ajax methods - Fix DOM insertion operators for null values
- Fix dataType being set for
$.getJSON