3
I’m creating a user menu, it stays on a page the part that is incorporated to other pages like index and home for example. It assumes the role of a widget that is only shown if there is session (logged in user) but it is shown with toggle effect of jQuery to show and hide.
On the script page the toggle effect works normally bad on the pages it displays via include or require it expands and automatically collects or opens and closes. As I can solve this, I have already searched in the API but without success I have already used "perventDefault()" also without success. Grateful for any help!
You are adding the same script twice?
– Sergio
No intendi? I call the page with require or include if there is session...so I only call once
– Lauro Moraes
My duvica is if in the final code there will be 2x the same script. I ask to try to mislead what might be the problem
– Sergio
I do the check with a simple "if(!isset)"...about the code and the javascript calls on the index there is only the ajax Cdn while in the code there is tbm will be that? I’m gonna see...
– Lauro Moraes
Yes @Sergio was this...two calls, at index and at home (among others) I have to call the CDN ajax and in the script tbm...ai I had to leave the menu on display None and a click event for toggle. It worked, thanks for the help :)
– Lauro Moraes
You’re welcome. You want to delete the question or I’ll leave you an answer?
– Sergio
If you want to leave a reply I thank (and favorite) maybe help other tbm
– Lauro Moraes