Comments (4)
Update: this is now available.
To achieve this, add a class onto the links you want to filter out, for example class="external".
Use the new 'filter' option to filter out these links. ( i.e. ':not(.external)' )
See the demo for a clearer example:
http://chriswojcik.net/demos/single-page-nav/
Let me know if you run into any problems!
from single-page-nav.
That feature isn't available, I've been meaning to add it in. I won't be able to work on this for a few days, but if you want to add it in yourself before I can, I'm sure conditional logic in the plugin would do the trick.
Here are a few ideas on how to target external links only:
http://css-tricks.com/snippets/jquery/target-only-external-links/
from single-page-nav.
Hello chris
I am working on a WordPress theme and used your plugin to navigate withing page. I was having same problem and found this filter. But in WordPress nav how can we add aclass dynamically to only that link which have external href value as http://.... Can you please help.
Thank you
from single-page-nav.
If I understand what you're asking, it sounds like more of a WP development question. I don't develop WP themes regularly, so I'll try to help the best I can.
I did find this article after a quick google search, can't promise it's 100% up to date, but sounds like what you might want on the WP back-end:
http://sevenspark.com/how-to/how-to-add-a-custom-class-to-a-wordpress-menu-item
If this is for a theme that will be distributed, I'm not sure if you can rely on the user to add the correct class.
Another option might be to target all links which are external in your navigation with javascript and then add a class to them.
Some jquery approaches for trying to target external links in this way:
http://css-tricks.com/snippets/jquery/target-only-external-links/
Like I said, I'm not a wordpress theme developer, so if these don't suit your needs, I'm not sure if there are other WP plugins or options out there that might fit your situation better.
from single-page-nav.
Related Issues (20)
- AutoScrolling HOT 1
- Bower Support? HOT 2
- External Link not working HOT 5
- The last section remains unselected if the document bottom is reached HOT 1
- Hero section not a section HOT 1
- Ancor Links outside of Nav?
- Goto Anchor
- Doesn't Detect position:fixed element (scrollmagic's pinned element)
- Question HOT 1
- Offset is ignored when accessing section directly HOT 6
- Nice Script with few problems
- Npm Support?
- Demo page is 404
- minified version != ordinary version
- Prevents linking to other pages from the navigation HOT 3
- Easing option HOT 3
- Demo doesn't work, looks like it's spam
- Using full url with # stops adding the current class . HOT 7
- Add active to li instead of a HOT 3
- 2 navigations in one page HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from single-page-nav.