*** SOLVED *** Menu with scrollspy does not work as expected

Issues related to hyperlinks and web site navigation.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/links.html
User avatar
Markus
 
 
Posts: 88
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

*** SOLVED *** Menu with scrollspy does not work as expected

Post by Markus » Thu Aug 22, 2019 4:06 pm

Hello,
I want to realize a menu with scrollspy function.

For this I created a small test project.
The page consists of four text elements and a menu with four buttons (navigation bar) which link to the four text elements. Hover style and scrollspy are activated in the menu.

Unfortunately all 4 buttons of the menu are already displayed in hover style. I actually expected that only the currently displayed section (Text1 ... Text4) is displayed in hover style in the menu.

Image

The project is attached. Can someone tell me what I did wrong?

Markus

Testproject: [link deleted]

btw: I couldn't figure out how to upload files to the forum, so i had to link the project externally.
Last edited by Markus on Fri Aug 23, 2019 2:58 pm, edited 2 times in total.

User avatar
Pablo
 
Posts: 17592
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Menu with scrollspy does not work as expected

Post by Pablo » Thu Aug 22, 2019 5:01 pm

The link to the file does not work for me.

User avatar
Markus
 
 
Posts: 88
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Re: Menu with scrollspy does not work as expected

Post by Markus » Thu Aug 22, 2019 5:19 pm

Hmm, thats weird.
Please try this. I uploded the project to an external file hoster (and removed the link from my post).

https://www.file-upload.net/download-13 ... T.wbs.html

User avatar
Pablo
 
Posts: 17592
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Menu with scrollspy does not work as expected

Post by Pablo » Thu Aug 22, 2019 6:28 pm

I'm sorry, but this download link does not work either.
All I get all kind of suspicious links to executables, bitcoins ads etc...

User avatar
Markus
 
 
Posts: 88
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Re: Menu with scrollspy does not work as expected

Post by Markus » Thu Aug 22, 2019 8:46 pm

Hmm, I don't understand that. All links are working for me without dubious advertising etc.
I put it on one of my servers again. Would you please try this again?

Link deleted

Thank you.
Markus
Last edited by Markus on Fri Aug 23, 2019 10:05 am, edited 1 time in total.

User avatar
Pablo
 
Posts: 17592
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Menu with scrollspy does not work as expected

Post by Pablo » Thu Aug 22, 2019 8:55 pm

When I click the link then the server responses with
"403 Forbidden"

User avatar
Markus
 
 
Posts: 88
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Re: Menu with scrollspy does not work as expected

Post by Markus » Fri Aug 23, 2019 5:28 am

Hello Pablo,

thanks for your patience.

You're not accessing the side from Germany. I suspect that the web server was not configured correctly because I was able to reproduce the problem via a proxy in the Netherlands.

Now I have configured the web server so that the problem doesn't occur anymore when using the proxy server.

Sorry for the inconvenience, but I hadn't noticed this incorrect configuration until now, because the accesses from Germany work perfectly.

The link above should now work (at least it does so via a Dutch proxy server).

Kind Regards
Markus

User avatar
Pablo
 
Posts: 17592
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Menu with scrollspy does not work as expected

Post by Pablo » Fri Aug 23, 2019 6:56 am

The website is still not accessible for me.

It may be quicker to email the file: support@pablosoftwaresolutions.com

User avatar
Markus
 
 
Posts: 88
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Re: Menu with scrollspy does not work as expected

Post by Markus » Fri Aug 23, 2019 10:04 am

Ok, thank you. I sent you an email with the testproject.

Markus

User avatar
Pablo
 
Posts: 17592
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Menu with scrollspy does not work as expected

Post by Pablo » Fri Aug 23, 2019 10:17 am

Thanks for sending the file.

The implementation is not correct.
The anchors should be on the same page. And although you have selected the current page in the link properties, for the browser this is another page.

1. Clear the link to the 'page2'
2. Now select the anchor without selecting a page.

Also, I think you will need to use bookmark objects.

Related tutorial:
http://wysiwygwebbuilder.com/affix_and_scrollspy.html

User avatar
Markus
 
 
Posts: 88
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Re: Menu with scrollspy does not work as expected

Post by Markus » Fri Aug 23, 2019 10:59 am

Thank you very much, Pablo.

It now works as expected in my test project.
Since other elements are also displayed as targets for the menu on the left, I assumed that I could also use them as bookmarks. Unfortunately I was wrong.

Will hope it also works with a menu on a masterframe using a content placeholder... I'll keep you informed. ;-)

Great support, thanks!

Markus

User avatar
Markus
 
 
Posts: 88
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Re: Menu with scrollspy does not work as expected

Post by Markus » Fri Aug 23, 2019 11:16 am

Oh man, it's not that easy.

If the menu is on a masterframe page, then I can select a bookmark without specifying a page name, but after closing the properties dialog of the menu an external link is created instead. When I reopen the property dialog ofn the menu it looks like this.

Image

This works very well on the main page, but if I want to switch from a subpage back to the main page, then nothing happens, because the browser does not know which page to load. :-(

If the mainpage is named "index.html" and the currently displayed page ist "impressum.html", then the link to the main page is named "impressum.html#Home", but it have to be "index.html#Home".

So, is this case solvable?

User avatar
Pablo
 
Posts: 17592
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Menu with scrollspy does not work as expected

Post by Pablo » Fri Aug 23, 2019 11:41 am

I'm sorry, this feature was not designed to be used with master pages.
Maybe in a future release.

User avatar
Markus
 
 
Posts: 88
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Re: Menu with scrollspy does not work as expected

Post by Markus » Fri Aug 23, 2019 2:53 pm

Okay, thank you for your efforts and your explanation, Pablo. As I said, excellent support, nowhere else I've got faster reactions and help. Chapeau!

I have now tried some constellations and come to the following solution.

Given is:
The masterframe menu is 120 pixels high.
The first (top) section to be displayed has a top padding of 60 pixels.

Image

Above the section is the bookmark placed as target for the link.

Image

To display the section correctly in both cases (jumping from the main page and jumping from a sub page) I had to set the following:

In the bookmark properties I have to set 183 pixels as offset, so that the section is displayed correctly when navigating within the main page.

I don't know why it has to be set to 183 pixels, because the menu height and padding of the first section is only 180 pixels in sum. But 180 px would be too few, because then you could scroll up 3 pixels manually after jumping to the bookmark.

Image

In the bookmark HTML property I have to insert the "offset trick" BeaconFries put me up to in another thread. This is the solution to get the correct align if the bookmark is jumped from another sub page. But here I have also set the offset to 183 pixels to align the section exactly to the top of view.

Image

I think I can live with this solution.
Thanks Pablo and BaconFries for you assistance.

If someone else came across this problem, I hope this thread and my explanations can help.

Markus

User avatar
BaconFries
 
 
Posts: 4631
Joined: Thu Aug 16, 2007 7:32 pm

Re: *** SOLVED *** Menu with scrollspy does not work as expected

Post by BaconFries » Fri Aug 23, 2019 3:02 pm

Thanks for the "Thanks" but the real support is from Pablo.. Maybe you could do a little tutorial on how you solved and post it to the following:
viewforum.php?f=26

Post Reply