为什么要在我脑海中添加脚本标签,弄乱工作代码?

时间:2013-01-09 16:53:39

标签: jquery jquery-mobile google-api

以下代码可以正常使用:

$('#transPage, #categorizePage, #IDKPage').live('pageinit', function() {
$('.theListItem .red').click(function() {
    var $changeColor = $(this).closest('div[data-theme="a"]').css("background-color", "#ff3333");
    });

$('.theListItem .green').click(function() {
    var $changeColor = $(this).closest('div[data-theme="a"]').css("background-color", "#008021");
    });

});

这也很有用:

$('#transPage, #categorizePage, #IDKPage').live('pageinit', function() {
    $('.trans .theListItem .red').click(function() {
        var $toRemove = $(this).closest('div[data-theme="a"]')

        $toRemove.animate({
            height: 0
        }, 500, function() {
            // This is the callback.
            $toRemove.remove();
        });

        return false;
    });
});

直到我取消注释:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>   

然后它就不再起作用了。问题是我需要那些脚本才能使用其他东西。什么想法可能是错的?谢谢。

为了进一步说明我的问题,以下是我现在在页面底部发布的整个工作主管:

<script src="js/jQuery/jquery-1.8.2.min.js"></script>

<!--script src="http://code.jquery.com/mobile/1.2.0-rc.2/jquery.mobile-1.2.0-rc.2.min.js"></script>-->
<script src="jquery.mobile-1.2.0-rc.2/jquery.mobile-1.2.0-rc.2.min.js"></script>
<!--<script src="jquery.mobile-1.2.0-rc.2/jquery.mobile-1.2.0-rc.2.min.css"></script>-->


<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>   
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>  -->

<script type="text/javascript" src="cubiq-iscroll-bad88fb/src/iscroll.js"></script>    




<script src="swipe/dist/jquery.swipeButton-1.2.1.js"></script>


<script src="js/scrollbar.js"></script>
<script src="js/script.js"></script>

<link rel="stylesheet" href="css/jQueryMobileStructure.css" />
<link rel="stylesheet" href="css/style.css" /> 
<link rel="stylesheet" href="css/nikostyle.css" /> 

<link href='http://fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>

1 个答案:

答案 0 :(得分:0)

如果这些脚本在您将这些内容添加到您的脑中之前已经有效,我认为这意味着您之前已经在某处或某些地方引用了jQuery脚本。如果我们看到更多代码可能会有所帮助,但我认为情况就是这样。