Cant get jquery to work in Django+Tailwind #2601
-
Dear reader, I'm new in webdev with the tailwind framework. And I like to know how to make Jquery work with tailwindcss examples My question is what links i'm missing in my template to access jquery part in the tailwindcss/ui part. it seems it also doesn't work on the one page playground: //tailwind.config.js plugins: [
] The only thing I load through the base.html is: //styles. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @metand-dotcom 👋 Did you write some jQuery to toggle the navigation (on hamburger menu click) based on the following code comment? <!--
Profile dropdown panel, show/hide based on dropdown state.
Entering: "transition ease-out duration-100"
From: "transform opacity-0 scale-95"
To: "transform opacity-100 scale-100"
Leaving: "transition ease-in duration-75"
From: "transform opacity-100 scale-100"
To: "transform opacity-0 scale-95"
--> You might need to add a custom class/id/data-attribute to the elements you want to target with jQuery. It's tricky to help without seeing a codebase, do you have an example repo somewhere? If you don't like using jQuery, I can recommend looking at AlpineJS for small UI interaction like toggling a navigation menu, it provides ma much simpler (and lightweight) implementation 👍 As a bonus, you can inspect the Tailwind UI demo examples with dev tools to see how we make it work 😅 |
Beta Was this translation helpful? Give feedback.
Hey @metand-dotcom 👋
Did you write some jQuery to toggle the navigation (on hamburger menu click) based on the following code comment?
You might need to add a custom class/id/data-attribute to the elements you want to target with jQuery. It's tricky to help without seeing a codebase, do you have an example repo somewhere?
If you don't like using jQuery, I can recomme…