Solved

CSS Titles and Alignment

Posted on 2013-12-29
2
245 Views
Last Modified: 2013-12-29
I have menu bars but I don't know how to put titles on them.  Also when you hover over the bar the box expands and text appears.  Two problems, text only appears if you hover over the blue box on the upper left.  And when the text does appear its not appearing to the right of the blue bars.  Also the blue bars are moving!  Any help is appreciated.  Thank you.  www.mediascrubber.com


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

Open in new window


<div id="sidebox">
    <div class="bars">
    <img id="but1">
    </div>
    <div class="bars">
    <img id="but2">
    </div>
    <div class="bars">
    <img id="but3">
    </div>
    <div class="bars">
    <img id="but4">
    </div>
    <div class="content">
    <span class="but1">Button One some more text</span>
    </div>
    <div class="content">
    <span class="but2">Button 2 some more text</span>
    </div>
     <div class="content">
    <span class="but3">Button 3 some more text</span>
    </div>
     <div class="content">
    <span class="but4">Button 4 some more 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: 39745268
http://jsfiddle.net/GaryC123/N4685/
New HTML
<div id="sidebox">
    <div id="bar-container">
    <div class="bars">
    <img id="but1">
    </div>
    <div class="bars">
    <img id="but2">
    </div>
    <div class="bars">
    <img id="but3">
    </div>
    <div class="bars">
    <img id="but4">
    </div>
        </div>
    <div class="content">
    <span class="but1">Button One some more text</span>
    </div>
    <div class="content">
    <span class="but2">Button 2 some more text</span>
    </div>
     <div class="content">
    <span class="but3">Button 3 some more text</span>
    </div>
     <div class="content">
    <span class="but4">Button 4 some more text</span>
    </div>
</div>

Open in new window

Additional CSS
#bar-container {
    width:205px;
    display:inline-block;
    float:left
}
.content span {
    display:none
}

Open in new window

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

Open in new window

0
 

Author Closing Comment

by:DS928
ID: 39745278
Thank you!  You are the best!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

756 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