Zepto not working

Hi I'm trying out the zepto.js library because it's so small...

I wrote the simplest line:

$('#content').animate({opacity: 0.25}, 0.5);

But it doesn't work, nothing happens?
intoxicated_curveballAsked:
Who is Participating?
 
hieloCommented:
It seems to be working for me (on firefox and chrome).
NOTE:
Target platforms
Safari 5+ (desktop)
Chrome 5+ (desktop)
Mozilla Firefox 4+
iOS 4+ Safari
Android 2.2+ Browser
Other WebKit-based browsers/runtimes
webOS 1.4.5+ Browser
BlackBerry Tablet OS 1.0.7+ Browser
Amazon Silk 1.0+
Opera 10+

So, if you are testing in IE, it will not work. I used:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="zepto.js"></script>
<script type="text/javascript">
Zepto(function($){
    $('#content').animate({opacity: 0.25}, 500);
});
</script>

</head>
<body>
	<div id="content">Hello</div>
</body>
</html>

Open in new window

0
 
hieloCommented:
> $('#content').animate({opacity: 0.25}, 0.5);
the duration should be in milliseconds.  You probably meant 0.5 secs. If that is the case try:
$('#content').animate({opacity: 0.25}, 500);//500millisecs=0.5secs

Also, make sure you call it once #content is ready/available:
Zepto(function($){
    $('#content').animate({opacity: 0.25}, 500);
});

Open in new window

0
 
intoxicated_curveballAuthor Commented:
Still doesn't work. I think it's the library failing, I might try another library, I don't think this one is very good?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.