0

Here is the code:

<ul id="gn-menu" class="gn-menu-main">
            <li class="gn-trigger"> 

            <a class="gn-icon gn-icon-menu">
            <div class="hamburger hamburger--arrow"> 
                <div class="hamburger-box">
                  <div class="hamburger-inner"></div>
                </div>
            </div>
            </a>

                <nav class="gn-menu-wrapper gn-open-part">
                    <div class="gn-scroller">
                    <ul class="gn-menu">
                            <li><a class="gn-icon" id="calendar" href="http://remindbuddy.com/main.php">Calendar</a>

                            </li>

                            <li>
                                <a class="gn-icon self" href="http://remindbuddy.com/self.php">Add For Self</a>
                            </li>
                            <li><a class="gn-icon events" href="http://remindbuddy.com/events.php">Events</a></li>
                            <li><a class="gn-icon view" href="http://remindbuddy.com/contacts.php">View Contacts</a></li>
                            <li>
                                <a class="gn-icon add" id="toggle">Add Contact</a>
                                <ul id="panel" style="display:none">
                                    <li><a href="http://remindbuddy.com/professional.php" <?php if($_SESSION['pro']==0){echo 'style="pointer-events: none;"';}?>>Professional</a></li>
                                    <li><a href="http://remindbuddy.com/personal.php">Personal</a></li>
                                </ul>
                            </li>

                            <li><a class="gn-icon profile" href="http://remindbuddy.com/profile.php">Profile</a></li>

                        </ul>
                    </div><!-- /gn-scroller -->
                </nav>
            </li>



                            <li class="pageTitle"><a href="#"class="title">Profile</a></li>

        </ul>

         <span class="left" id="calendarTool">Calendar</span>

What I want is that, for hover on li#calendar to change css property of span#calendarTool. I have tried:

 #calendar:hover #calendarTool, 
 #calendar:hover + #calendarTool, 
 #calendar:hover ~ #calendarTool

But nothing seems to work.How to get this done in the given scenario.

Thanxx in advance!!

1 Answer 1

1

#calendar is not a sibling nor a parent of #calendarTool so you will not be able to leverage css to handle this. This will require JS/Jquery or a restructure of html so that #calendarTool is a sibling to or nested under #calendar

Quick Jquery example: JS Fiddle

$('#calendar').on('mouseover', function() {
    $('#calendarTool').css('background', 'blue');
});

$('#calendar').on('mouseout', function() {
    $('#calendarTool').css('background', 'transparent');
});
Sign up to request clarification or add additional context in comments.

1 Comment

As long as the they are really siblings and the #calendarTool comes after, you can do #calendar:hover ~ #calendarTool. Here is a quick example of how it works: jsfiddle.net/b93cg4dm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.