Solved

JQuery Hover Issue

Posted on 2013-12-29
2
280 Views
Last Modified: 2013-12-29
I want to hover over a CSS image and I have these buttons that are showing up on top.  How do I get rid of the buttons and just have the image?

$(function() {
		$("#sidebox").mouseenter(function(){
        $(this).animate({width: '400px'});
		})
		$("#sidebox").mouseleave(function(){
        $(this).animate({width: '190px'});
		})
		$(".bars button").hover(function(){
  		$(".content ."+$(this).attr("id")).toggle()  
		})
		})

Open in new window


<div id="sidebox">
    <div class="bars">
    <button id="but1">button 1</button>
    <button id="but2">button 2</button>
    </div>
    <div class="content">
    <span class="but1">some text</span>
    <span class="but2">some other text</span>
    </div>
</div>

Open in new window

0
Comment
Question by:DS928
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39745178
Do you mean...?
<div id="sidebox">
    <div class="bars">
    <img id="but1">
    <img id="but2">
    </div>
    <div class="content">
    <span class="but1">some text</span>
    <span class="but2">some other text</span>
    </div>
</div> 

Open in new window


$(function() {
		$("#sidebox").mouseenter(function(){
        $(this).animate({width: '400px'});
		})
		$("#sidebox").mouseleave(function(){
        $(this).animate({width: '190px'});
		})
		$(".bars img").hover(function(){
  		$(".content ."+$(this).attr("id")).toggle()  
		})
		})

Open in new window

0
 

Author Closing Comment

by:DS928
ID: 39745188
Perfect!  You are the One!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Duplicate Elements with JS / jQuery 3 24
Html using "Or" in condition 3 24
Hta File displays dynamic File names 4 44
Building JSON/JQuery Results Display 11 22
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question