Comments (3)
So, I came up with a bit of a crude work-around.
I added text-align: left to the "#nav a" element since it doesn't actually change anything, but is needed to have a definite property to compare to that won't be automatically assigned by the browser.
function navtoggle() {
if ($("#nav a").css("text-align") == "left"){
$("#nav li").click(function() {
navigation.toggle();
});
}
}
//Activates navtoggle() on page load
$(document).ready(function(){
navtoggle();
});
//Checks again to see if the text-align property has changed
$(window).resize(function(){
navtoggle();
});
from responsive-nav.js.
It seems you have already found the workaround on this one, but for my own curiosity: where did you initially insert the code? I actually came across this same issue in one of my attempts at using that code.
$("#nav a").click(function() {
navigation.toggle();
});
from responsive-nav.js.
There’s a new functionality added in the new version which makes your issue disappear (live today/tomorrow). Basically, you don't anymore have to write that JS since there an option called "closeOnNavClick".
from responsive-nav.js.
Related Issues (20)
- Navigation height with nested <ul> HOT 2
- responsiveNav is not defined HOT 2
- left nav cascaded
- Nav is buged
- closeOnNavClick variable changes location
- Multi-Level Responsive Nav
- Just a navigation. Clicking on navigation doesn't slide to anchor points?
- Checking if class exists
- Add opacity onScroll
- Support for Multi-level Nav HOT 1
- Appears from left or right
- Change hamburger to be an image so doesnt flash on page load
- Multilevel not opening on Android Chrome
- Using different customToggle when js-nav-active
- Plugin installation failed. (No valid plugins were found.)
- Nav not scrollable on dropdowns (where submenus available)
- Not working
- Unable to preventDefault inside passive event listener invocation. HOT 1
- How to initialize with a toggle?
- Explanation for installation process
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 responsive-nav.js.