Jump to content


Photo

Trying to get a DIV to show up on a hover state...


  • Please log in to reply
2 replies to this topic

#1 Jim R

Jim R
  • Members
  • PipPipPip
  • Advanced Member
  • 531 posts

Posted 05 December 2017 - 06:43 PM

Here is my to generate a list, which is hidden other than a link (Offers) to signify there are existing offers.  

			echo '<div class="colleges">[<a href="#"><span class="lists">Offers</span></a>]</div>';
			echo '<div id="list">';
		//	Turn CSV into unordered list
			$offersList = $line['colleges'];
			$offersList = explode(", ",$offersList);
			asort($offersList);
				foreach ($offersList as $offers) {
				echo '<li>' . $offers . '</li>';
		}
			echo '</div>';
		}

When a User hovers over the [Offers] link, I'd like the list to show up:

#list {
	display: none;
}

#list a:hover {
	display: block;
}

Nothing changes when I hover over Offers



#2 requinix

requinix
  • Administrators
  • Maddening Administrator
  • 9,464 posts
  • LocationWA

Posted 05 December 2017 - 08:17 PM

Hovering over the link is annoying. Hovering over the div.colleges is easy:
div.colleges:not(:hover) + div.list {
	display: none;
}
Get rid of the #list ones you have now, and use a class instead of an ID.
The Reimann Zeta Function Trolley Problem | "Summer is when I, the great ice fairy, can show my true power!"

#3 Jim R

Jim R
  • Members
  • PipPipPip
  • Advanced Member
  • 531 posts

Posted 05 December 2017 - 08:46 PM

Very nice...thanks.  






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users