NetTalk Central

Author Topic: How realise "Go to top" button?  (Read 3601 times)

miasoft

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
How realise "Go to top" button?
« on: April 12, 2019, 07:57:07 AM »
How realise "Go to top" button?
NetTalk 9

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11179
    • View Profile
Re: How realise "Go to top" button?
« Reply #1 on: April 14, 2019, 10:02:13 PM »
Hi Mia,

more information please? Go to top of what? browse? form? page?
Tell us more about where you might use this button, and what you want it to do...

cheers
Bruce


miasoft

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: How realise "Go to top" button?
« Reply #2 on: April 14, 2019, 11:58:16 PM »
Hello!
I want to use subj in browse in first. I found plugin https://markgoodyear.com/2013/01/scrollup-jquery-plugin/, but I don't understand how insert it to my NWS

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: How realise "Go to top" button?
« Reply #3 on: April 15, 2019, 01:32:40 AM »
Hi,

You can do it in a very simple way without using javascript, just HTML.

Add 2 xHTML routines to your browse procedure:

1) This is the anchor - ie the location to go to
Routine Name: top
Location: Before <form>
XHTML: <div id="top"></div>

2) This is your Go to top link at the bottom of the page
Routine Name: bottom
Location: After </div>
XHTML: <a href="#top">Go to top</a>

This will insert a link with the text "Go to top" at the bottom of your page. When the link is clicked the page will scroll to the top.

You can make it nicer by creating a button instead of the link and you can do smooth scrolling etc but I'll leave this up to you to figure out. Now you've got the basic technique.

Peter
« Last Edit: April 15, 2019, 01:34:12 AM by peterH »

miasoft

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: How realise "Go to top" button?
« Reply #4 on: April 15, 2019, 06:45:33 AM »
Thanks! It's work.
But I changed
Quote
2) This is your Go to top link at the bottom of the page
Routine Name: bottom
Location: After </div>
to
Location: After </table>


peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: How realise "Go to top" button?
« Reply #5 on: April 15, 2019, 08:15:58 AM »
That?s fine too, put it where ever you like it to be.

The first routine puts an anchor on your page (a place to go to). You Can put as many anchors as you want/need on a page.

Peter