为什么fiddle代码在dropbox上运行不一样

why the fiddle code is not run as same on dropbox?

本文关键字:运行 不一样 dropbox fiddle 代码 为什么      更新时间:2023-09-26

我从dropbox下载了一个代码。当我运行我的代码时,它就工作了。我运行"simple.html"这是链接https://www.dropbox.com/sh/a4mrvmft99u0kr7/Dj44R-fqNy

并检查我在fiddle上的所有代码。它不会像在浏览器中那样正常工作。。为什么??http://jsfiddle.net/v4d2s/

    $(document).ready(function(){
        $("#browser").treeview({
            toggle: function(e) {
            alert($(this).find('ul').closest.id);
            //alert('===='+this.attr('id'));
                console.log("%s was toggled.", $(this).find(">span").text());
            }
        });
        $("#add").click(function() {
            var branches = $("<li><span class='folder'>New Sublist</span><ul>" + 
                "<li><span class='file'>Item1</span></li>" + 
                "<li><span class='file'>Item2</span></li></ul></li>").appendTo("#browser");
            $("#browser").treeview({
                add: branches
            });
        });
        /*$("#swipe").click(function() {
            alert('--')
            var effect = 'slide';
    // Set the options for the effect type chosen
    var options = { direction: 'right' };
    // Set the duration (default: 400 milliseconds)
    var duration = 700;
    // $('#test').show();
     $("#test").animate({left:'250px'});
    //$('#test').toggle(effect, options, duration);
        });*/
        $('#swipe').toggle(
    function(){
        $('#test').animate({
            position:'absolute',
            left:'50px',
            border:'1px solid black'

        }, 1500);
    },
    function(){
        $('#test').animate({
             position:'absolute',
            left:'-250px',
        }, 1500);     
});
    });

您的问题在于:

http://jsfiddle.net/SimplyAzuma/v4d2s/1/

jQuery 1.8.3, 1.7.2, and 1.6.4 will work.

使用旧版本的jQuery,它会非常好地工作。

你也看不到图像,因为你的css引用了"images/image.png"。对于JSFiddle,没有图像文件夹。将这些更改为"image.png",它应该可以工作。