?
Solved

JQuery Hover Issue

Posted on 2013-12-29
2
Medium Priority
?
283 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 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

800 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