J!Extensions Store™
Forum
Welcome, Guest
Please Login to access forum.
Re:Modify scroll to bottom (1 viewing) 
Go to bottom
TOPIC: Re:Modify scroll to bottom
#4204
Atlanta Internet Design
Junior Boarder
Posts: 25
User Offline
Modify scroll to bottom 3 Years, 9 Months ago Karma: 0  
Hi,

In a previous post you were kind enough to show me where in the mod_pagescrollbuttons/helper.php to adjust my scroll to the top and it works perfectly. I have been trying to control the scroll down in the same manner and have not found where to modify it. Currently the Scroll down button scrolls to the very bottom of the page. Can I limit how far down the scroll goes? http://www.atlantainternetdesign.com/

Thanks
 
Logged Logged  
  The administrator has disabled public write access.
#4205
John Dagelmore
Admin
Posts: 3520
User Offline
Re:Modify scroll to bottom 3 Years, 9 Months ago Karma: 74  
Hi,

it's in the same file and is managed by the following code:

Code:

$('html, body').animate({ scrollTop: $(document).height() - $(window).height(), }, $animationSpeed);
Cheers
 
Logged Logged  
  The administrator has disabled public write access.
#4207
Atlanta Internet Design
Junior Boarder
Posts: 25
User Offline
Re:Modify scroll to bottom 3 Years, 9 Months ago Karma: 0  
Hi,

Thanks for the reply. I did find the code on line 107 but nothing I tried worked. I know I'm not the sharpest knife in the drawer so if you could kinda show what to change I shall forever be indebted
 
Logged Logged  
  The administrator has disabled public write access.
#4208
John Dagelmore
Admin
Posts: 3520
User Offline
Re:Modify scroll to bottom 3 Years, 9 Months ago Karma: 74  
Hi,

so probably the problem is that you have active the dynamic scrolling and you need to modify another line.

The following one:

Code:

scrollTop: document.body.scrollHeight || document.documentElement.scrollHeight
can be modified to have a reduced scrolling to the bottom subtracting an arbitrary value:
Code:

scrollTop: (document.body.scrollHeight || document.documentElement.scrollHeight) - 2000
 
Logged Logged  
 
Last Edit: 2016/02/15 00:04 By @store$eco#mm!.
  The administrator has disabled public write access.
#4222
Atlanta Internet Design
Junior Boarder
Posts: 25
User Offline
Re:Modify scroll to bottom 3 Years, 9 Months ago Karma: 0  
Hi,

Tried that code and it broke both page up and page down. To reiterate what I am trying to do: When the home page loads, I would like the scroll down button to scroll the page down to a certain point and stop. Currently it just goes to the bottom. The scroll up button works perfectly:

// If a short press is detected, go to end scrolling value for the page
if ( new Date().getTime() <= ( start + longpress ) ) {
// Scroll to top
if($(this).hasClass('backtop') {
$('html, body'.animate({
scrollTop: 1000
}, $animationSpeed);
} else {
// Scroll to end
$('html, body'.animate({
scrollTop: document.body.scrollHeight || document.documentElement.scrollHeight
},
$animationSpeed);
}
}

Sorry to keep bugging you, I know the answer is here somewhere.

Thanks
 
Logged Logged  
  The administrator has disabled public write access.
#4223
John Dagelmore
Admin
Posts: 3520
User Offline
Re:Modify scroll to bottom 3 Years, 9 Months ago Karma: 74  
Hi,

so why not just use the standard parallax feature instead of make life complex and focus to alter the source code?

On the demo area you see the menu with some anchors example: http://demo.storejextensions.org/jsitemap/#target1

Just use the old plain HTML anchors and the plugin will apply the scrolling effect.

Also being a free plugin we can't waste so much time as you may understand.

Thanks
 
Logged Logged  
  The administrator has disabled public write access.
Go to top