Results 1 to 6 of 6

Thread: Minor issue with jQuery Scroll to Top Control v1.1

  1. #1
    Join Date
    Apr 2015
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Minor issue with jQuery Scroll to Top Control v1.1

    1) Script Title: jQuery Scroll to Top Control v1.1

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm

    3) Describe problem: I've noticed that the "scroll up" link is always present on the page, even when the arrow image is hidden. When I'm all the way at the top of the page and the image is hidden, the link is still there and I'm able to click it. Is there any way to make the link completely vanish when it's not visible, instead of just hiding the image?

  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

    Using a text only editor like Notepad, open the scrolltopcontrol.js script and replace the function of the same name with this one (additions highlighted):

    Code:
    	togglecontrol:function(){
    		var scrolltop=jQuery(window).scrollTop()
    		if (!this.cssfixedsupport)
    			this.keepfixed()
    		this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
    		if (this.state.shouldvisible && !this.state.isvisible){
    			this.$control.stop().css({visibility: 'visible'}).animate({opacity:1}, this.setting.fadeduration[0])
    			this.state.isvisible=true
    		}
    		else if (this.state.shouldvisible==false && this.state.isvisible){
    			this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1], function(){this.style.visibility = 'hidden';})
    			this.state.isvisible=false
    		}
    	},
    Save changes and use that version. The browser cache may need to be cleared and/or the page refreshed to see changes.
    - John
    ________________________

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

  3. #3
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    Post your html code for the page in question or a link to it.
    The arrow isn't supposed to show until you scroll 100px down the page.

    Name:  up.png
Views: 92
Size:  1.3 KB

  4. #4
    Join Date
    Apr 2015
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That code didn't entirely correct the problem.

    Go here, make sure you're scrolled all the way up so that the button is hidden (don't scroll down after the page has loaded), and put your cursor over the bottom right part of the page where it would normally be. Your cursor and the "SCROLL UP" message shows that a link is still there, even though the button isn't visible.

    I noticed that the problem is corrected after you've scrolled down and back up again, but I want the link to be completely gone when the page is loaded.

    http://www.thirdsidethreads.com/

  5. #5
    Join Date
    Apr 2015
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Fixed!

    I altered this tiny part of the code and it works perfectly now.

    Code:
    .css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, visibility:'hidden', opacity:0, cursor:'pointer'})
    Thanks for your help.

  6. #6
    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

    Sure! Funny, I was thinking it might need something like that, but on the demo page it was initially seen even with the page at its top, so I thought - maybe not.
    - John
    ________________________

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

Similar Threads

  1. jquery scroll to top control
    By ozetigerman in forum Dynamic Drive scripts help
    Replies: 11
    Last Post: 09-06-2014, 03:15 PM
  2. jQuery Scroll to Top Control for custom links
    By sylver in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 02-16-2012, 08:12 AM
  3. jQuery Scroll to Top Control
    By pookeyblow in forum Dynamic Drive scripts help
    Replies: 10
    Last Post: 09-17-2011, 07:13 AM
  4. jQuery Scroll to Top Control doesn't work >.<
    By Emeralda in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 06-26-2011, 09:51 AM
  5. jQuery Scroll to Top Control v1.1 Error
    By quddusaliquddus in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 06-30-2009, 05:13 AM

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
  •