将2个JS合并在一起的问题

时间:2014-11-03 22:57:26

标签: javascript jquery html

我有2页使用JS。 1表示FULL PAGE和幻灯片效果,1表示添加jquery音频播放器。

这两个页​​面都能很好地独立工作......

以下是每页的代码

完整页面HTML          

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- FULL PAGE include JS  -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.fullPage.js"></script>

<!-- FULL PAGE include CSS   -->
<link rel="stylesheet" type="text/css" href="jquery.fullPage.css" />    
<link rel="stylesheet" type="text/css" href="form.css"  />
<link rel="stylesheet" type="text/css" href="examples.css" />


<script type="text/javascript">
    $(document).ready(function() {
        $('#fullpage').fullpage({
            sectionsColor: ['#1bbc9b'],
            anchors: ['firstPage'],
            slidesNavigation: true,
            navigation: true,
            navigationPosition: 'right',
        });
});
</script>

</head>
<body>

<div id="fullpage">
    <div class="section" id="section1">
        <p>Listen to our Music for FREE...<br>and download any MP3 as a VIP Member</p><br>
        <div id="includedContent"></div>
    </div>
</div>

</body>
</html>

第二页:有效的音频JQUERY

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="plugin/css/style.css">
<link rel="stylesheet" type="text/css" href="demo/css/demo.css">

<script type="text/javascript" src="demo/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="plugin/jquery-jplayer/jquery.jplayer.js"></script>
<script type="text/javascript" src="plugin/ttw-music-player-min.js"></script>
<script type="text/javascript" src="demo/js/myplaylist.js"></script>

<script type="text/javascript">
    $(document).ready(function(){
        var description = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id tortor nisi. Aenean sodales diam ac lacus elementum scelerisque. Suspendisse a dui vitae lacus faucibus venenatis vel id nisl. Proin orci ante, ultricies nec interdum at, iaculis venenatis nulla. ';

        $('#includedContent').ttwMusicPlayer(myPlaylist, {
            autoPlay:false, 
            description:description,
            currencySymbol:'',
            buyText:'DOWNLOAD',
            jPlayer:{
                swfPath:'plugin/jquery-jplayer' 
            }
        });
    });
</script>

</head>

<body>
    <div id="includedContent"></div>
</body>
</html>

我的问题......我需要将它们合并在一起..我需要我的jquery播放器出现在我将FIV放在我的FULL PAGE网站的#section1中的地方,当我合并代码时,它不是工作。我知道它与某些JS有关,我包含了相互冲突......但我不知道如何诊断问题以及如何开始寻找解决方案。

我也不确定我的2代码部分是否适合         $(文件)。就绪(函数(){ 做得对吗?

以下是我的MERGE HTML的HTML ...但它不起作用。

感谢。

组合代码的HTML:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- FULL PAGE CSS -->
<link rel="stylesheet" type="text/css" href="jquery.fullPage.css" />    
<link rel="stylesheet" type="text/css" href="form.css"  />
<link rel="stylesheet" type="text/css" href="examples.css" />

<!-- FULL PAGE JS -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.fullPage.js"></script>


<!-- AUDIO PLAYER CSS -->
<link rel="stylesheet" type="text/css" href="plugin/css/style.css">
<link rel="stylesheet" type="text/css" href="demo/css/demo.css">


<!-- AUDIO PLAYER JS  -->
<script type="text/javascript" src="demo/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="plugin/jquery-jplayer/jquery.jplayer.js"></script>
<script type="text/javascript" src="plugin/ttw-music-player-min.js"></script>
<script type="text/javascript" src="demo/js/myplaylist.js"></script>    


<script type="text/javascript">
    $(document).ready(function() {
        $('#fullpage').fullpage({
            sectionsColor: ['#1bbc9b', '#f5f5f5', '#7BAABE', '#1bbc9b', '#ccddff', '#f5f5f5'],
            anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', '5thpage', '6thpage', 'lastPage'],
            menu: '#menu',
            slidesNavigation: true,
            navigation: true,
            navigationPosition: 'right',
        });
});
</script>


<!-- audio player script  -->
<script type="text/javascript">
    $(document).ready(function() {
        var description = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id tortor nisi. Aenean sodales diam ac lacus elementum scelerisque. Suspendisse a dui vitae lacus faucibus venenatis vel id nisl. Proin orci ante, ultricies nec interdum at, iaculis venenatis nulla. ';

        $('#includedContent').ttwMusicPlayer(myPlaylist, {
            autoPlay:false, 
            description:description,
            currencySymbol:'',
            buyText:'DOWNLOAD',
            jPlayer:{
                swfPath:'plugin/jquery-jplayer' 
            }
        });


    });
</script>



</head>
<body>

<div id="fullpage">
    <div class="section" id="section1">
        <p>Listen to our Music for FREE...<br>and download any MP3 as a VIP Member</p><br>
        <div id="includedContent"></div>
    </div>
</div>

</body>
</html>

0 个答案:

没有答案