Solved

JQuery Hover Issue

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON help 8 40
hide and show spans from dropdown selection 3 30
Submitting form with no refresh at the end 2 28
Jquery syntax 12 23
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.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

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