|
Replies:
6
-
Pages:
1
-
Last Post:
14 Jul 21, 06:27
Last Post By: JeffTucker
|
|
|
Posts:
68
Registered:
13-Dec-2007
|
|
|
|
Neptune: appearance of scroll-to-top icon
Posted:
13 Jul 21, 00:11
|
|
|
When scrolling the index page of thumbnails, the "scroll-to-top" icon/link appears after scrolling down about 400px. I haven't been able to figure out what line of code I can add in the UI to override that value to allow the icon/link to appear sooner, perhaps 200px or so (maybe that's the developer's intention - make it difficult for those who really don't know what they are doing to mess with the skin's code  ). It seems to be related to the nescroll.js function, but I don't see how the 400px or so is calculated. Is there a simple entry in the code tab of the UI that I can use to set a diffierent scroll value?
|
|
|
Posts:
8,362
Registered:
31-Jan-2006
|
|
|
|
Re: Neptune: appearance of scroll-to-top icon
Posted:
13 Jul 21, 00:46
in response to: rfm2
|
|
|
Had to mull over that one for a moment. It's hard-coded into the Javascript (and it's not in nescroll.js, which is something entirely different), so there's no convenient variable replacement possible. But there's always a way. First, don't do this if you're using a parallax theme image - things will get mangled. But otherwise, you can head for Neptune > Code > HTML, and in the first box (stuff to be placed before the closing </head> tag), enter: <script>
function topScroll() {
$(window).scroll(function(){
if($(window).scrollTop() > 200) {
$('#ne-pagetop').fadeIn(700);
}
else {
$('#ne-pagetop').fadeOut(700);
}
});
$('#ne-pagetop').click(function(){
$('body,html').animate({scrollTop:0},700);
return false;
});
};
</script>
You can tinker with the threshold value (200 in this example).
|
|
|
Posts:
68
Registered:
13-Dec-2007
|
|
|
|
Re: Neptune: appearance of scroll-to-top icon
Posted:
13 Jul 21, 23:43
in response to: JeffTucker
|
|
|
|
I'm a little slow in responding to your reply, but I always appreciate your quick and thorough responses to my questions.
Interestingly, that proposed script function to be added under the code tab is exactly what you included when you set up a template of pure HTML for me to use in rebuilding the list/links of all my albums (AllAlbums.html) some 7 years ago. I inserted the script in one of my albums just now as a test and, as expected, it works great.
When I use a theme image I usually use the fixed instead of parallax, but I will try to remember to not use that new function in the code tab if I do experiment with parallax.
Thanks for the help.
|
|
|
Posts:
8,362
Registered:
31-Jan-2006
|
|
|
|
Re: Neptune: appearance of scroll-to-top icon
Posted:
13 Jul 21, 23:48
in response to: rfm2
|
|
|
When I use a theme image I usually use the fixed instead of parallax, but I will try to remember to not use that new function in the code tab if I do experiment with parallax.
The structure of a page with a parallax theme image is a very strange beast. I got it to work, but I don't fully understand what it's doing. To be honest, I had to guess my way into a lot of it. 
|
|
|
Posts:
68
Registered:
13-Dec-2007
|
|
|
|
Re: Neptune: appearance of scroll-to-top icon
Posted:
14 Jul 21, 00:13
in response to: JeffTucker
|
|
|
|
I have a few albums with Venus, and since the Venus code tab doesn't include the HTML option, I thought just for the fun of it I would insert the script function in the index.html of a Venus album to see, if I was desperate enough to want the quicker scroll top icon, I could add it to a finished album. Changed the "ne" to "ve" in 3 places, inserted the script just above the head closing, and it works great. Wouldn't be so great if it was an album that was going to be re-made often (as mine are), but an interesting possibility that may come in handy some day.
Likewise, if I add it to the Venus skin source folder, it would still have to be re-inserted every time you (and I) update Venus, Oh well, it's an idea anyhow.
Edited by: rfm2 on 14 Jul 2021, 00:17
|
|
|
Posts:
8,362
Registered:
31-Jan-2006
|
|
|
|
Re: Neptune: appearance of scroll-to-top icon
Posted:
14 Jul 21, 00:23
in response to: rfm2
|
|
|
I've been gradually adding things to Venus that are available in its cousin skins, and now that my code is more common, and modular, I can bring things like that to the skin without a lot of agony. The code insertion is one more thing to add to the list.
(Having said that, however, the whole file iteration routine in Venus is, of necessity, wildly different from Neptune, for example. It's the source of a lot of confused thrashing about on my part.  )
|
|
|
Posts:
8,362
Registered:
31-Jan-2006
|
|
|
|
Re: Neptune: appearance of scroll-to-top icon
Posted:
14 Jul 21, 06:27
in response to: JeffTucker
|
|
|
|
The next release of Venus has the expanded Code tab (along with a bunch of other new stuff). As usual, it took longer to update the documentation than it took to write the code. I plan to release it today.
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|