开发者

jquery apply context menu on all children

开发者 https://www.devze.com 2022-12-21 03:32 出处:网络
I am using a jquery context menu plugin (http://www.trendskitchens.co.nz/jquery/contextmenu/) which works fine but I want to work for all children of a selector currently I have the below but it only

I am using a jquery context menu plugin (http://www.trendskitchens.co.nz/jquery/contextmenu/) which works fine but I want to work for all children of a selector currently I have the below but it only applies to divs with class area and I need it to apply on div's with class area and all its 开发者_JAVA百科children.

$('#container-area .area').contextMenu()

Any ideas on wildcard jquery selectors tried * with no luck

Lee


This should work, using .andSelf() (documentation):

$('#container-area .area').children("div").andSelf().contextMenu();


$('#container-area .area').contextMenu().find('*').contextMenu()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号