Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CSS Titles and Alignment

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

636 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