javascript

  • I’d suggest you remove the 1.12.4 copy – Rory McCrossan 3 hours ago
  • ATM in my project I have the following links and scripts

    As you can see in the below snippet when you click the link it doesn’t work. It should display a hidden div with text. However, if you remove the JS code it works.

    @ng_real_ninja: How could I fix my js code in order it works with Bootstrap 4 collapse-div? #angularjs…

    As you can see in the below snippet when you click the link it doesn’t work. It should display a hidden div with text. However, if you remove the JS code it works.

    My problem is I need to use this JS code in order to get a smooth scroll down in whole page (for example: when someone click a link and it sends you to at the end of the page etc..)

    Is there any way to make both my JS and this bootstrap 4 code work together? They work perfectly separately.

    Note you’re including 2 versions of jQuery. I’d suggest you remove the 1.12.4 copy – Rory McCrossan 3 hours ago

    Thank you for your quick reply. I have tried to remove one of my jquery, but If I do that some stuff of my page stop working.. However, I will take it in consideration. – Mostaza 3 hours ago

    Slim build

    Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for all your web animations. Along with the regular version of jQuery that includes the ajax and effects modules, we’ve released a “slim” version that excludes these modules.

    It is an amazing reply. However, It works only here but not in my project. I mean, now when you click on the link (in my project) it doesn’t show anything it sends you at the top of the page.. why? I have been double checking it again if there was something wrong in my HTML and it works perfectly (showing the hidden div) when I remove the js code with the conflicted code. Should I add or remove something else? – Mostaza 2 hours ago

    The comments on the question are on the right path, but I believe you’ll want to use a version of jQuery that both supports $.animate() (the “slim” packages do not), and also supports Bootstrap 4 alpha (1.12.4 does not). You’ll likely want to use the full 3.1.1 package, but definitely consult the docs yourself to know for sure:

    I also forgot to mention that you’ll likely want to replace your “return false” with event.preventDefault() in the click callback. (This will allow click events to continue through your code to the toggling logic.) The answer from gaetanoM demonstrates this all more effectively. If you’re still having issues please provide more info. – Lincoln Anderson 2 hours ago

    Hi I have made all the changes you and @GeatanoM told me. And now it opens and everything work. However when I click my link now it opens but it sends me at the top of my page, how could I stop it? – Mostaza 2 hours ago

    Could you post the code with your updates, maybe in a JSFiddle? Also since you’ve made significant changes to resolve your jQuery conflicts and are having a more specific interaction problem now, this might be better as a new question. – Lincoln Anderson 2 hours ago

    javascript