Solved

JQuery Hover Issue

Posted on 2013-12-29
2
278 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

785 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