I'm doing a college project that involves using a jQuery image slider and I wanted to implement a smooth scroll anchor jQuery as well. The problem is: they don't work together...if I comment one out, the other will work but, they just don't work together. I read about a noConflict solution but, I'm a beginner and I have no idea how to work out this problem.
If anyone is able to help me out I'd be very grateful of you assistance, and hopefully this will save myself and my colleagues time in the future. The live version of the site is
http://caseykrein.com/html5/scuba/ Here's what the head of my document looks like:
<!-- smooth scroll anchor -->
<script type = 'text/javascript' src = 'jquery.js'></script>
<script type = 'text/javascript' src = 'jquery.scrollTo.js'></script>
<script type = 'text/javascript' src = 'jquery.smoothAnchors.js'></script>
<script type = 'text/javascript'>
$(document).ready(function(){
$.smoothAnchors("slow");
});
</script>
<!--end-->
<link rel="stylesheet" type="text/css" href="lightbox-0.5/css/jquery.lightbox-0.5.css" />
<link rel="stylesheet" type="text/css" href="prettyphoto/css/prettyPhoto.css" />
<script type="text/javascript" src="li-slider/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="li-slider/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="lightbox-0.5/js/jquery.lightbox-0.5.min.js"></script>
<script type="text/javascript" src="prettyphoto/js/jquery.prettyPhoto.js"></script>
<link rel="stylesheet" type="text/css" href="li-slider/skins/Trend/skin.css" />
<script type="text/javascript" src="li-slider/js/li-slider-animations-1.1.min.js"></script>
<script type="text/javascript" src="li-slider/js/li-slider-1.1.min.js"></script>
<script type="text/javascript">
$(window).load(
function() {
$("#li-banner").sp_Li_Slider({
animation : "Regular-Exception", // type of Animation: Regular, Random, Regular-Custom, Random-Custom, Regular-Exception, Random-Exception
transitions : 'None', // None|transition_name(s) // List of custom animations - for full list please reference to the preview (works only with "Regular-Custom, Random-Custom, Regular-Exception , Random-Exception ")
auto_play : true, // true|false - auto play on start
repeat : true, // true|false|number - how many times to repeat all slides
modalMode : 'prettyPhoto',// lightBox|prettyPhoto|off
goToSlideOnStart : 1, // value //any slide number starting from 1 or url?sp_slide=2
timer : 'line_bottom',// no|line_bottom|line_top|line_right|line_left
pauseOnMouseOver : true, // true|false
tooltip : 'image', // none|text|image
tooltipSize : 20, // value // % of slider dimentions from 0 to 100. Use 0 to disable it
shuffle : false, // true|false - randomize the images order
delay : 2000, // value // time period of a photos displaying /default - 3000 (3 sec)
trans_period : 800, // value // time period of chenging the photos /default - 1000 (1 sec)
vert_sections : 10, // value // number of vertical sectors (only for Animation type Blind) /default - 15
sqr_sections_Y : 4, // value // number of squeres by vertical (only for Animation type Sqr) /default - 5
active_links : true, // true|false //activate links of photos /default - true
buttons_show : true, // true|false //show all buttons /default - true
play_pause_show : true, // true|false //show Play or Pause buttons /default - true
next_prev_show : true, // true|false //show Next or Prev buttons /default - true
auto_hide : true, // true|false // auto hide buttons ot start (when auto_play is true)
buttons_show_time : 2000, // value //time period befor displayins of the buttons /default - 100
buttons_show_delay : 500, // value //time period for appearing of the buttons /default - 300
buttons_hide_time : 2000, // value //time period befor disappearing of the buttons/default - 2000
buttons_hide_delay : 500 // value //time period for disappearing of the buttons /default - 500
});
}
);
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>