help with show/hide text on hover
I am not sure the best or most elegant way to do this. What I am trying now isn't working. Essentially, I have a horizontal row of icons and when a user hovers over the icons I want text to display in a div to the right of the icons with the text being unique per each icon.
My solution isn't very elegant (and doesn't work), because for each icon I would need to write a separate function, and also a separate paragraph ID, so I am hoping for suggestions to a better solution.
Here is what I have attempted:
- //JQuery
- (function($){
- $(document).ready(function(){
- $(".btn-theme_all").hover(function() {$("p#AllText").toggle();
- });
- })(jQuery);
-
- //HTML
- <ul>
- <li><a href="#" class="btn-theme_all" data-filter="*">ALL</a></li>
- <li><a href="#" class="btn-theme_web" data-filter=".webdesign"></a></li>
- <li><a href="#" class="btn-theme_writing" data-filter=".writing"></a></li>
- <li ><a href="#" class="btn-theme_sandbox" data-filter=".sandbox"></a></li>
- </ul>
- </nav>
- <div id="PortfolioInfo"><p id="AllText">All of my portfolio including web, writing and sandbox</p></div>
-
-
-
- //CSS
- #PortfolioInfo{
- background-color:#eee;
- text=align:center;
- padding:10px;
- width:250px;
- height:250px;
- color:#333;
- font-weight:bold;
- border:3px solid #ccc;
- position:absolute;
- right:0;
- border-radius:5px;
- margin-right:50px;
- }
-
- p#AllText{
- display:none;
- }