Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Anchor Links Issue

Featured Replies

Hi,

 

I am in the middle of constructing this page: http://inspiredworx-labs.com/sites/splash/services/

As you can see there are 5x links labelled All, Advertising, Digital, Design & Consulting.

When clicking on one of the links (Advertising for example), the content rearranges but because of the anchor links (#advertising - for example), the top of the site is now out of view. The page gets scrolled down to the anchor links.

 

Is there anyway I can overcome this?

 

I hope I've made sense there!!

 

Thanks in advance

isn't that what an anchor is meant to do?

What if your header was fixed somehow? Different layer or some such and the linky stuff was margin'd down the page?

  • Author

isn't that what an anchor is meant to do?

What if your header was fixed somehow? Different layer or some such and the linky stuff was margin'd down the page?

 

I am only using the links to switch the content when clicked, I didn't want the page to 'jump' down to the link itself.

Is there another way around this??

 

Thanks

does it help if you remove the name attribute from the links?

Use event.preventDefault()

 

+1.

  • Author

Use event.preventDefault()

 

Thanks!

 

It doesn't seem to work on page load though, the page directs straight to the #all anchor tag... any ideas how to prevent this?

 

Thanks

  • Author

Pass it the option:

 

useHash : false

 

It renders my jQuery filter useless then though... :p

It renders my jQuery filter useless then though... :p

 

Problem is the options aren't very well documented, but I'd assume it provides an alternative method of making it work, without the hash identifiers - they wouldn't provide an option that completely breaks the script.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.