+ 2
I'm trying to check if there was a click on a special button or on the document itself by the: if (... || ...) { }
There is a dropdown-item "Product" in the Menu. After the first click on this item, the menu will become 270px long. And I want to the second click on "Product" or on the document make the menu 200px long again. The code there is in tags /*Start*/ and /*End*/ https://code.sololearn.com/WwxoqRcQTeNu/?ref=app
5 odpowiedzi
+ 1
See if you logout the following
console.log($(".dropdown-toggle").click);
It prints a function ,it isn't returning like true or false
+ 1
Abhay
Then how can i check which of the two elemet was clicked ?
0
Why aren't you using that var I =0 ;
Concept here also
onclick funcrion(){
That globally var I =0;
And if(I=0) {do 270 ; and I=1; }
If(I=1){do 200; and I=0 ;
}
}
It will work here also
Afterall jQuery is library of js.
0
If you are using jQuery I will suggest you to use toogle instead of dropdown .it will also look nice;