我正在尝试使此功能正常工作。我试图让它仅在单击 li 时执行读取 xml 的函数
以下是我的 jQuery:
<script>
$("ul.productcat li").on('click', function (e) {
var $this = $(this),
// Class of the one to be shown
subclazz = $this.data("class");
$('article > div').removeClass('show');
$('.' + subclazz).addClass('show');
mygallery(subclazz);
});
</script>
function mygallery(config){
<script type="text/javascript" src="gallery/js/jquery.js"></script>
<script type="text/javascript" src="gallery/js/swfobject.js"></script>
<script type="text/javascript" src="gallery/js/flashgallery.js"></script>
<script type="text/javascript">
jQuery.flashgallery('gallery/gallery.swf', 'gallery/'+config+'.xml', { width: '650px', height: '600px', background: 'transparent' });
</script>
}
任何帮助,将不胜感激。