0
上的一個小項目,我想實現一個jquery滑塊保持網站的支持頁面上推薦工作的滑塊。爲了讓生活更輕鬆,我希望將證明書包含在XML文檔中。滑塊可對頁面正常,但當我嘗試用一個函數來獲取XML文檔中的文字見證,它的工作原理,以及朝鮮的火箭。使用與jQuery XML來填充文字
腳本中:
<head>
<title>Crutchfield Customer Support - Online Support Center</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="support.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" type="text/javascript"></script>
<script src="slider/jquery.bxSlider.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#slider1').bxSlider({
auto: true,
autoControls: false,
nextText: '',
prevText: ''
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type: "GET",
url: "testimonials.xml",
dataType: "xml",
success: function(xml) {
var select = $('#slider1');
$(xml).find('testimonials').each(function(){
var text = $(this).find('text').text();
select.append("<li class='test'>"+text+"</li>");
});
}
});
});
</script>
</head>
HTML滑塊:
<div id="testimonials">
<div class="testimonialGroupOne">
<ul id="slider1">
<li>loading</li>
</ul>
</div>
</div>
我可以添加另一個滑塊,但可能不是,可能問題是與divitis?
所以基本上有序列表不填充,這裏的xml文件至今:
<?xml version="1.0" encoding="ISO-8859-1"?>
<testimonials>
<text>"I have been doing business with Crutchfield for over fifteen years and have yet to have a negative experience. Their customer service is second to none."</text>
<text>"I've been a Crutchfield customer for over 20 years. I've found their customer service and technical support to surpass every other vendor in this business. Without exception, every contact I've had with Crutchfield employees, I have found them to be professional, competent, respectful and patient."</text>
</testimonials>
UPDATE:http://danielparmelee.com/testbed/crutchfield_test/現場的support.html看時它似乎在工作,但離開李空白 – danparm 2012-04-18 19:23:39
UPDATE2:http://danielparmelee.com/testbed/crutchfield_test/support.html腳本加入我的告別賽文字滑塊,但滑塊是現在死了 – danparm 2012-04-18 19:35:28