我有多个在我的网站上使用 jquery 的实例(如图像滑块和导航),但如果我不多次调用 jquery,它们将不起作用。
例如,除非我两次调用脚本,否则下面的 2 个片段将不起作用。请帮忙。(我的页面上有更多的 jquery 调用以及调用不同的库)我不能只调用最新的库一次并完成它吗?我试过了,还是不行。
<!--menu -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/newnav.css" />
<script type="text/javascript" src="js/navdoublecolumn.js"></script>
<script>
<!--
ddmegamenu.docinit({
menuid:'solidmenu',
dur:0,
easing:'easeInOutCirc' //<--no comma after last setting
})
// -->
</script>
<!-- slide -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="js/jquery.tabSlideOut.v1.3.js"></script>
<script type="text/javascript">
$(function(){
$('.slideout1').tabSlideOut({
tabHandle: '.slideouthandle1', //class of the element that will become your tab
pathToTabImage: 'images/slideouttab_chat.jpg',//path to the image for the tab //Optionally can be set using css
imageHeight: '150px', //height of tab image //Optionally can be set using css
imageWidth: '40px', //width of tab image //Optionally can be set using css
tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left
speed: 200, //speed of animation
action: 'click', //options: 'click' or 'hover', action to trigger animation
topPos: '215px', //position from the top/ use if tabLocation is left or right
leftPos: '20px', //position from left/ use if tabLocation is bottom or top
fixedPosition: true //options: true makes it stick(fixed position) on scroll
});
});
</script>