Solved

CSS Titles and Alignment

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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
Add Rows on a Table 8 50
Can't find an open element in HTML 5 52
Presenting my portfolio on the web? 11 52
carousel control extend past the images 9 25
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

737 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