My query is somewhat similar to this discussion: Implementing a dynamic min-height on a div using JavaScript but with a slight twist.
I am working on a dropdown menu within a WordPress site, integrated with RoyalSlider. The height of the slider div adjusts based on the size of the browser window.
However, I seem to be encountering some unexpected results. I have implemented the code provided as the top answer in the referenced thread and made the necessary adjustments to fit my specific setup:
$("#menu-main-menu > li.menu-parent-item > ul.sub-menu").css("min-height", function(){
return $("#new-royalslider-1").height();
});
As per my understanding, this snippet should set the minimum height of the ul.sub-menu to match the height of the RoyalSlider div.
Nevertheless, it consistently returns a value of 400px, regardless of the actual browser dimensions. Am I overlooking something here?