我在這裏丟失了什麼?我試圖在加載頁面時從href中刪除類「jp-playlist-current」。本頁加載時,我不想要任何「當前」樣式。我只想要當用戶點擊鏈接時顯示'當前'。jQuery - 當加載JPlayer時removeClass'current'
不幸的是,由於這個代碼是動態填充的,我無法給出該類的靜態視圖。相反,看看截圖圖像貼在下面這個鏈接:
http://dixiedevils.com/code.jpg
這裏是頁面的完整代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Untitled</title>
<script type="text/javascript">
$(document).ready(function(){
$('div.jp-type-playlist div.jp-playlist li.jp-playlist-current a').removeClass('jp-playlist-current');
//$('div.jp-type-playlist div.jp-playlist li').removeClass('jp-playlist-current');
});
</script>
</head>
<body>
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio">
<div class="jp-type-playlist">
<div class="jp-playlist">
<ul>
<!-- below here is where the dynamic JQ content is placed: -->
<li></li>
</ul>
</div>
</div>
</div>
</body>
</html>
儘管來自@Palash Mondal的解決方案也有效,但對我來說,這個解決方案似乎更容易適合我的編碼。謝謝大家。 – mar2195
感謝您提供反饋 – VenkateshKumar