Welcome to TalkGraphics.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2013
    Posts
    3

    Default Scroll to top script mess up everything else?

    Hi all!

    I�m not a newbie to WD since i used it for a couple of years but this problem i can�t solve by myself.

    I�m doing a new site and on the firstpage i have the Slideshow, Cycle 4, which is really nice. But when i putting in the script from www.scrolltotop.com to have a animated "scroll to top" function it messes up the slide show. The slideshow repeats all the images all over the page??
    I�ll think that there is a "collision" somewhere in the scripts/code but i haven�t the skills to solve that?

    I have put the "Scroll to top" code in a placeholder within the site and the "icon" shows and is fully functional but the slideshow are showing all the images, repeating them from top to bottom?

    Click image for larger version. 

Name:	without-code.jpg 
Views:	171 
Size:	88.4 KB 
ID:	95806 Click image for larger version. 

Name:	withcode.jpg 
Views:	149 
Size:	205.5 KB 
ID:	95807

    Hopefully you understand what i mean when you look att the images.

    Thanks! Kalle

  2. #2

    Default Re: Scroll to top script mess up everything else?

    Forget about it. That's a bad solution. Here's a simpler alternative. Put following code to the page head code section:
    Code:
    <script type="text/javascript">
    function my_scr2top()
    {
    	var x=window.pageXOffset;
    	var y=window.pageYOffset;
    	if(xr_ie)
    	{
    		x=document.documentElement.scrollLeft;
    		y=document.documentElement.scrollTop;
    	};
    	window.scrollTo(x/2,y/2);
    	if(x+y>4) setTimeout("my_scr2top()",50);
    };
    </script>
    Then add following link to the button to start scrolling:
    Code:
    javascript:my_scr2top()

  3. #3
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,839

    Default Re: Scroll to top script mess up everything else?

    I haven't time to experiment but I imagine the Slideshow is using a jQuery instance placed there by Xara.
    You are also calling a second jQuery library
    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    for your button.

    I would remove this one line and see if that works.

    It's not a good idea to rely on too many web calls to resources you don't have control over. I would search for a simple JavaScript function and embed that instead.

    Acorn

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,839

    Default Re: Scroll to top script mess up everything else?

    Not tested this directly but it should work: http://www.talkgraphics.com/showthre...tion-What-kind

    Acorn

  5. #5
    Join Date
    Dec 2007
    Location
    Sunshine Coast BC, Canada. In a beautiful part of BC's temperate rainforest
    Posts
    9,864

    Default Re: Scroll to top script mess up everything else?

    Actually the solution that Steve posted works very well, it was written by Covoxer a Xara developer. You can see a working example on my Good Morning Sunshine website if you click the link in my signature
    [SIGPIC][/SIGPIC]
    My current Xara software: Designer Pro 365 12.6

    Good Morning Sunshine.ca | Good Morning Sunshine Online(a weekly humorous publication created with XDP and exported as a web document) | Angelize Online resource shop | My Video Tutorials | My DropBox |
    Autocorrect: It can be your worst enema.

  6. #6
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,839

    Default Re: Scroll to top script mess up everything else?

    No problem with Covoxer's solution, just it scrolls to page top.
    My approach scrolls to any anchor, up or down and the delay is altered in the Link not the code so you can flood your page with the ability to scroll up or down.

    Horses for courses.

    Acorn

  7. #7
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,921

    Default Re: Scroll to top script mess up everything else?

    Acorns example is far more versatile, it allows for scrolling up and down the page to whatever required anchor with variable animation speeds, not just resrolling to the top of the page.
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  8. #8
    Join Date
    Jan 2010
    Location
    Bradford, England
    Posts
    1,827

    Default Re: Scroll to top script mess up everything else?

    So much choice, I have to admit that acorn's posted solution is very handy, both the ability to scroll at a preferred rate and the ability to scroll all over the place. Nice
    Flawless Form. Faultless Function. Crafted by Cloud

    https://www.cloudwebagency.co.uk

 

 

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
  •