View Full Version : Resolved why does slideshow image change causes smooth scroll to jump??

03-09-2012, 03:31 AM
i'm hoping somebody can help me with this. i have a website that uses a smooth scroll js and also a js for a slideshow with manual prev/next controls (found here: http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm)

i got the slideshow working on a separate page, but when i tried to insert it into my existing page that has the smooth scroll script, page jumps to one of the lower smooth scroll anchors while it changes images, so i have to scroll back up to see that it had changed in the slideshow. :confused:

this is the code that i'm using for the smooth scroller:

<script src="smooth.pack.js" type="text/javascript"></script>
<script type="text/javascript">
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
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_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_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];}

this is the code that i'm using for the slideshow:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript" src="fadeslideshow.js">

* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more

<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [911, 454], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
//<--no trailing comma after very last image element!
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "toggler1"

this is the code i'm using for the toggler (prev/next buttons):

<div id="toggler1"><a href="#" class="prev"><img src="arrow_left_black.gif" style="border-width:0"; align="left" /></a><a href="#" class="next"><img src="arrow_right_black.gif" style="border-width:0"; align="right" /></a></div>
<div id="fadeshow2"></div>

is there a way to keep the smooth scroll from jumping to a different point on the page? any help would be much appreciated! i'm fairly new at this, and i don't know where to begin with this issue... thanks sooo much! :)

03-09-2012, 04:24 AM
Is this a different issue than the one we just resolved? If so:

Please include a link to the page on your site that contains the problematic code so we can check it out.