2014-09-29 44 views
0

我已經從互聯網上下載了2個包。一個用於製作列表中的項目,以頁面形式顯示,另一個用於製作.mp3文件的jPlayer。Javascript:某些類在兩個javascripts/ccs中使用相同名稱定義兩次

列表頁面的next page/previous page按鈕與MP3播放器的next song/previous song按鈕具有相同的名稱。它們都被稱爲jp-nextjp-previous

這些文件的List-Paging

<link rel="stylesheet" href="http://shiro-desu.com/scr/itemsperpage/style.css"> 
<script type="text/javascript" src="http://shiro-desu.com/scr/itemsperpage/jquery-1.8.2.min.js"></script> 
<script src="http://shiro-desu.com/scr/itemsperpage/jPages.js"></script> 

這些文件的jPlayer

<script type="text/javascript" src="http://shiro-desu.com/scr/jquery/jquery.min.js"></script> 
<script type="text/javascript" src="http://shiro-desu.com/scr/jquery/jquery.jplayer.min.js"></script> 
<script type="text/javascript" src="http://shiro-desu.com/scr/jquery/jplayer.playlist.min.js"></script> 
<link href="http://shiro-desu.com/scr/jquery/jplayer.blue.monday.css" rel="stylesheet" type="text/css" /> 

我看到它,改變在List-Paging文件中有一些名字會做的伎倆的方式。
問題是,我絕對沒有javascipt,jQuery的經驗,我懇請在這個問題上的幫助。

唯一的問題是,next page/previous page背景,是通過的next song/previous song背景影響

我上傳了一個jsfiddle上的示例來向您展示問題。

- >http://jsfiddle.net/5svd5mnh/

+0

退房http://jplayer.org/latest/developer-guide/#jPlayer-option-cssSelector自定義選擇器 – 2014-09-29 21:26:03

+0

@ChristopherMarshall你知道我應該把類似於http://jplayer.org/ latest/developer-guide /#jPlayer-detail-cssSelector this?這看起來像我在找什麼,我真的不知道,我完全是新來的。 – rez 2014-09-29 21:31:02

+0

我不明白我必須編輯哪些文件,那些文件在哪裏?我有'jplayer.playlist.min.js','jquery.jplayer.min.js','jquery.min.js','jplayer.blue.monday.css' – rez 2014-09-29 21:34:06

回答

2

一個避免這個問題的方法是使用:

<?php echo'<link href="http://shiro-desu.com/scr/jquery/jplayer.blue.monday.css" 
rel="stylesheet" type="text/css" />'; ?> 
在你的頁面

,在<body>部分只有當你真正使用jPlayer。
這樣就不會同時導入2個.css文件。
但是這意味着您在將不能在相同的.html頁面中使用jPlayerList-Paging

相關問題