Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5956131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:12:47+00:00 2026-05-22T18:12:47+00:00

Hi pretty new to Dojo basicly I am trying to attach a event to

  • 0

Hi pretty new to Dojo basicly I am trying to attach a event to ‘every’ class then on mouseover I would like to reveal the closet div (changing display to block) with a class name. However after numerous attempts I am unable to do so.

Here is the html :

<div class="navElement"> 
                    <a href="" class="navSectionTitle">Sound &#38; Vision &#43;</a>
                    <div class="subMenuHolder">
                        <ul>
                            <li><a href="#">Televisions</a>,</li>
                            <li><a href="#">LCD TVs</a>,</li>
                            <li><a href="#">Plasma TVs</a>,</li>
                            <li><a href="#">3D TVs</a>,</li>
                            <li><a href="#">MP3 Players</a>,</li>
                            <li><a href="#">Hi Fi</a>,</li>
                            <li><a href="#">MP3 Docks</a>,</li>
                            <li><a href="">More</a> &#43;</li>

                        </ul>
                    </div>  
                </div>

                <div class="navElement"> 
                    <a href="" class="navSectionTitle">Computers &#38; Software  &#43;</a>
                    <div class="subMenuHolder">
                        <ul>
                            <li><a href="#">Laptops</a>,</li>
                            <li><a href="#">Desktops Computers</a>,</li>
                            <li><a href="#">Software</a>,</li>
                            <li><a href="#">Printers</a>,</li>
                            <li><a href="#">External Hard Drives</a>,</li>
                            <li><a href="#">Internal Hard drives</a>,</li>
                            <li><a href="">More</a> &#43;</li>

                        </ul>
                    </div>  
                </div>

The dojo I am attempting to use is below :

dojo.require("dojo.NodeList-traverse");    
dojo.query(".navSectionTitle").forEach(function(node, index, nodelist){
            dojo.connect(node , "onmouseover", function(evt){
                var here = dojo.query(node).closest(".subMenuHolder");
                here.style.display = 'block';
                console.log(here);
            });
        });

Not sure if this is best practice but would appreciate any help, many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:12:48+00:00Added an answer on May 22, 2026 at 6:12 pm

    Closest will return the parent of the node in query.
    so go for next method as shown below.
    Make sure to wrap all the event attaching code inside the dojo.addOnLoad block

        dojo.query(".navSectionTitle").forEach(function(node, index, nodelist){     
            dojo.connect(node , "onmouseover", function(evt){               
              //this is the menu you want to show       
              console.log(dojo.query(node).next('.subMenuHolder')[0])
            });
        });
    

    Hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty new to dependency injection and I'm trying to figure out if this is
Pretty new to C# (and I would describe myself as a beginner in programming,
Pretty new (2 weeks) into Objective-C and Xcode, and I'm trying to add my
Im pretty new with javascript, so im not sure how I would do this.
I'm pretty new to my company (2 weeks) and we're starting a new platform
I'm a pretty new C# and .NET developer. I recently created an MMC snapin
I'm pretty new to the idea of recursion and this is actually my first
I am pretty new to php, but I am learning! I have a simple
I am pretty new to VB.NET - and I'm struggling to convert the signature
I'm pretty new to JSF and the many many related technologies out there. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.