buttons within button clickable indepedently

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: egami, macek, gesf

Post Reply
iago
php-forum Active User
php-forum Active User
Posts: 36
Joined: Thu Mar 26, 2020 2:33 pm

Sat Apr 11, 2020 8:55 am

Hello, I'm working on the following editor: http://science-travel-com.stackstaging.com/cpicks/

In the left colum I have buttons, onclick triggers a drop down menue here (I have no entries for now, but this will follow).
No my question: Can I trigger these buttons: ('sort', '+', 'DEL') independently from the parent button? Thanks.
User avatar
hyper
php-forum GURU
php-forum GURU
Posts: 1190
Joined: Mon Feb 22, 2016 5:52 pm

Sat Apr 11, 2020 9:34 am

What happened when you tried it?
iago
php-forum Active User
php-forum Active User
Posts: 36
Joined: Thu Mar 26, 2020 2:33 pm

Sun Apr 12, 2020 3:19 am

hyper wrote:
Sat Apr 11, 2020 9:34 am
What happened when you tried it?
I happens that the sourrounding button is triggered, of course. I mean it must be like that, that the click-event of the parent button is not inherited to the children button elements. I didn't find aynthing with google.
iago
php-forum Active User
php-forum Active User
Posts: 36
Joined: Thu Mar 26, 2020 2:33 pm

Tue Apr 14, 2020 3:01 am

I deactivate the click-functionality of the parent button, but then I have to refresh the page in order to make onclick work again

Code: Select all

  $('.plus').on('click',function(){
	     
	        $('.accordion').off('click');
	        
	       //...........
	    });
Post Reply