Coder Social home page Coder Social logo

Comments (3)

NobleWolf avatar NobleWolf commented on July 28, 2024

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.

hvietphan avatar hvietphan commented on July 28, 2024

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.

arielsalminen avatar arielsalminen commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.