Feature request: Target custom attributes of a child element

Earlier I was trying to get all my nav dropdowns to sit to the right when they drop down. I noticed there was “data-x-stem=dl” in the dropdown element but when I changed it in the custom attributes, it applied it to the whole nav element.
Ended up using custom jQuery to target it:

jQuery(".menu-item-380").hover(function(){
jQuery(".menu-item-380 > ul").attr(“data-x-stem”,“dl”);
});

Hi @RubberDuckers,

We will most likely be adding a way to do that with an element setting. Regretfully, there isn’t a way to do it at the moment by customizing the javascript - at least not that I can think of that would be reliable/stable. All child dropdowns inherit the positioning of their parent. The data-x-stem attribute is automatically updated to reverse in cases where you run out of screen space.

Hey @alexander - thanks for that. Yeah this was an odd request, the first dropdown out of three in the menu went the other way (natural way) and the client wanted them all the same… I did explain the reasoning but you know what it’s like!
Anyway, that jQuery snippet worked (at least to keep them happy) and if it disappears at some point, I’m sure they’ll not even notice :wink:
Though whilst playing with that I did (accidentally) make the menu behave differently, coming out from the side, going above etc so to overwrite it (when actually needed and if stable) would be a cool feature.

Loving the megamenu and modal stuff btw, good work!

I see what you mean. Glad to know it’s working in the interim with that customization.