Results 1 to 3 of 3

Thread: prev/next class is linking to smooth scroll (but it shouldn't be!)

  1. #1
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default prev/next class is linking to smooth scroll (but it shouldn't be!)

    hello!
    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/dynamici...nslideshow.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.

    this is the code that i'm using for the smooth scroller:
    Code:
    <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];}
    }
    </script>
    this is the code that i'm using for the slideshow:
    Code:
    <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>
    <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: [
    		["images/asr-final-night_resize.jpg"],
    		["images/v2-final_resize.jpg"],
    		//<--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):
    Code:
    <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!
    Last edited by somethingaboutsunshine; 03-09-2012 at 03:39 AM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Hey! What's this:

    Code:
    <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>
    In your fadeSlideShow init from your post it shows the wrapperid as fadeshow1. Perhaps you just included that fadeshow2 div by overcopying.

    Anyways, without seeing the page, it's hard to say. I would try this first though - change the toggler div's code to:

    Code:
    <div id="toggler1"><img class="prev" src="arrow_left_black.gif" style="cursor:pointer; border-width:0" align="left"  /><img class="next" src="arrow_right_black.gif" style="cursor:pointer; border-width:0" align="right" /></div>
    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    somethingaboutsunshine (03-09-2012)

  4. #3
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    that worked perfectly!! thank you sooo so so much!

    and yes, i saw that fadeshow2 div and removed it earlier

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •