Zepto not working

Posted on 2012-09-11
Last Modified: 2012-09-18
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?
Question by:intoxicated_curveball
    LVL 82

    Expert Comment

    > $('#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:
        $('#content').animate({opacity: 0.25}, 500);

    Open in new window


    Author Comment

    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?
    LVL 82

    Accepted Solution

    It seems to be working for me (on firefox and chrome).
    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"
    <html xmlns="">
    <script type="text/javascript" src="zepto.js"></script>
    <script type="text/javascript">
        $('#content').animate({opacity: 0.25}, 500);
    	<div id="content">Hello</div>

    Open in new window


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
    This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
    In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now