I have a stack of buttons that, when hovered upon, make a text box appear on the right side of the stack. The purpose of the text box is to be a scroll box, but in order to do that, I need to be able to scroll. Unfortunately, when I take my mouse off the button TO scroll that box, the box goes away because my mouse is no longer on the button to "activate" it.
You can see the live example on my page here. Scroll down to the "Commissions" box on the left and you will see it.
I'm looking to get more of the effect that the one on this page shows in "Art Info".
Here is the CSS code:
*{background:white; border:none; padding:0; margin:0;}
.gr{padding:0 !important;}
.gr-top img, .gr1, .gr2, .gr3 {display:none;}
.gr-top, .bottom, a.external:after, .left br {display:none;}
a{text-decoration:none; font-weight:normal;}
.external{display:block;}
h1{
font-family:Times;
text-align:center;
font-size:18px;
color: #83d4cc;
font-style: italic;
letter-spacing: 3px;
line-height:10px;
}
h2{
font-family:Times;
text-align:center;
font-size:13px;
color: #252424;
font-style: italic;}
.gr-box{
z-index:99!important;
font-family:Times;
text-align:center;
font-size:13px;}
.text{
position:relative;
margin:10px 10% 10px 10%;}
.left{width:180px;}
.textbox{
display:none;
width:276px;
height:276px;
margin-top:32px;
position:absolute;
overflow:scroll;
background: #83d4cc;
left:210px;
color: #ffffff;
top:0;}
.wrap:hover .textbox{display:inline-block;}
.button{
display:block;
color: #FFFFFF;
background: #252424;
border-radius:0px;
padding:9px 0px;
margin-bottom:4px;}
.button:hover{
color: #FFFFFF;
background: #83d4cc;
}
.button span{
display:none;
font-size:0.85em;}
.button:hover span{display:inline;}
Here is the HTML code:
<div class="left"><h1>Commissions</h1><h2>Hover for more information</h2><div class="wrap"><a class="button" href="http://gracefuleigh.deviantart.com/gallery/48200599">Manipulations</a><div class="textbox"><div class="lmf"></div>Manipulations textbox</div></div><div class="wrap"><a class="button" href="http://gracefuleigh.deviantart.com/gallery/47299585">Howrse Layouts</a><div class="textbox"><div class="lmf"></div>Howrse Layouts textbox</div></div><div class="wrap"><a class="button" href="http://gracefuleigh.deviantart.com/gallery/49118216">Gallery Directories</a><div class="textbox"><div class="lmf"></div>Gallery Directories textbox</div></div><div class="wrap"><a class="button" href="http://gracefuleigh.deviantart.com/gallery/48666470">Journal Skins</a><div class="textbox"><div class="lmf"></div>Journal Skin textbox</div></div><div class="wrap"><a class="button" href="http://gracefuleigh.deviantart.com/gallery/47299612">Banners</a><div class="textbox"><div class="lmf"></div>Banners textbox</div></div><div class="wrap"><a class="button" href="http://gracefuleigh.deviantart.com/gallery/48200600">Stamps & Icons</a><div class="textbox"><div class="lmf"></div>Stamps & Icons textbox</div></div><div class="wrap"><a class="button" href="http://gracefuleigh.deviantart.com/gallery/49118169">Folder Menus</a><div class="textbox"><div class="lmf"></div>Folder Menus textbox</div></div> <div class="wrap"><a class="button" href="">Other</a><div class="textbox"><div class="lmf"> </div> Other textbox </div></div> <h2>Page design by :devgracefuleigh:</h2> </div> <div class="clear"></div>
Thank you so much for the help, in advance!
- Leigh
You can use jquery fadeIn to make the textBox appear (see http://api.jquery.com/fadein/) with the onmouseover event, then have an icon or link to close the text box when the user is finished.
I hope this this fiddle can help you out http://jsfiddle.net/S7EjW/
The element which is appearing on hover needs to be inside the element which is hovered, else when the mouse moves out it triggers the mouseleave event which fades the element off.
HTML
<div class="element">
<span class="title">Hover Me to see info.</span>
<span class="info">This is a sample info span that appears on hovering the title.</span>
</div>
JS
$(".element").hover(function(){
$(this).find(".info").fadeIn(500);
}, function(){
$(this).find(".info").fadeOut(500);
});
Fiddle Link : http://jsfiddle.net/z3EML/
To make hover effect remain, you need to use Javascript or jQuery.
On hovering of element, you'll add the class to the element which you need to show.
Like this :
HTML :
<div class="menu">
Hover
</div>
<div class="textbox">
<input type="text"/>
</div>
CSS :
.menu{
float:left;
}
.show_textbox{
background:#dadada;
padding:5px;
color:#000;
text-decoration:none;
}
.textbox{
float:left;
display:none;
margin-left:5px;
}
.show{
display:block!important;
}
JS :
$(document).ready(function(){
$('.show_textbox').hover(function(){
$('.textbox').addClass('show');
});
});
This jQuery will add the .show class to the element when it is hovered. You can add CSS properties to .show which you need to add in hover state.
It'll keep the hover state until the page is refreshed.
I couldn't comment, so im answering you question with what i know off the top of my head.
look into CSS3, there is an operator ">" that you should become familiar with
Related
I am trying to make it so that the review button underneath the chat overlay container can be clicked when the chat overlay container is on top. The size of the chat overlay container can't be changed. I have tried with stacking options z-index. I thought about the CSS option pointer-events but the x in the top right and the circle chat button needs to remain clickable. Any help is much appreciated thanks.
The following is an image in inspector with the chat overlay container highlighted.
The following is simplified version of how the html is structured for the chat overlay and the card container.
<div class="card">
<p class="title">example.com</p>
<button class="review">Review</button>
</div>
<div class="overlay">
<div class=help-text>
<button class="dismiss-help">X</button>
<p>Got any questions....</p>
</div>
<span class="overlay-launcher">
<button class="launcher-button">Circle</button>
</span>
</div>
I would continue exploring the use of pointer-events.
pointer-events is an inherited property, so if a value isn't explicitly set, it will inherit the computed value from it's parent.
Try pointer-events: none on the chat overlay, but pointer-events: auto on the children that should remain clickable. eg close button and toggle chat button (or one of their common ancestors).
// Not required. Only here to demonstrate click events
document
.querySelectorAll('button')
.forEach(button =>
{
button.addEventListener('click', (e) =>
{
console.log(`clicked ${e.currentTarget.textContent.trim()}`)
})
})
.overlay {
background : rgba(128, 128, 128, 0.5);
position : absolute;
top : 0;
pointer-events : none;
outline : 1px solid blue;
}
.overlay button {
pointer-events : auto;
}
<div class="card">
<p class="title">example.com</p>
<button class="review">Review</button>
</div>
<div class="overlay">
<div class=help-text>
<button>X</button>
<p>Got any questions....</p>
</div>
<span class="overlay-launcher">
<button class="launcher-button">Circle</button>
</span>
</div>
z-index and position:relative help the ".help-text",".launcher-button" classes to stay on top of other contents.
.overlay{
display:flex;
flex-direction:column;
align-items:end;
width:fit-content;
}
.help-text{
background:white;
width:fit-content;
box-shadow: 1px 1px 5px;
border-radius: 5px;
display:flex;
flex-direction:column;
align-items:end;
z-index:1;
position:relative;
/* z-index and position:relative help .help-text to stay on top of other contents */
}
.help-text>p{
font-family:sans-serif;
}
.dismiss-help{
background-color:transparent;
border:none;
}
.launcher-button{
width:3rem;
aspect-ratio:1;
border-radius:50%;
border:none;
background-image:linear-gradient(to left,rgba(0,100,180,1) 30%,rgba(0,0,255,1));
margin-top:1rem;
z-index:1;
position:relative;
/* z-index and position:relative help launcher button to stay on top of other contents */
}
#samplebtn{
position:absolute;
top:40%;
left:90px;
height:2rem;
}
<div class="overlay">
<div class=help-text>
<button class="dismiss-help">X</button>
<p>Got any questions....</p>
</div>
<span class="overlay-launcher">
<button class="launcher-button">Circle</button>
</span>
</div>
<button id="samplebtn">Review
</button>
I've styled a <p> tag which behaves as a cart button.
Now I want to make a pop up box which will appear on hover of the <p> tag containing cart details in it.
HTML
<div id="product_list">
<p class="poverlay" style="display:none;">Cart Details</p>
test elements test elements test elements test elements test elements
</div>
CSS
<style>
#product_list{
display:block;
z-index:1;
width:100px;
height:100px;
border:1px solid #ccc;
padding:10px;
}
#product_list:hover > p.poverlay {
display:block !important;
top:0px;
left:0px;
position:absolute;
padding:10px;
color:#f00;
font-weight:bold;
z-index:2;
}
</style>
You can use something like this in your CSS:
Your pop up starts hidden:
#popupId{
display: none;
}
You make it appear when you hover your p element
p:hover #popupId{
display: block;
}
And you fill it with the information you want to show.
yeh I did it !!!! in the way I want.
Thanks all Josh ,Ankit, thriqon , punitha
I have looked around and cannot find an answer for this, maybe I am just making my code too convoluted.
I have a div that is making up my menu links. The wrapper div will be a link that contains a div for my CCS Circle and a span for my link text:
<div class="menu-item">
<a href="#">
<div class="menu-circle"></div>
<span class="menu-text">Home</span>
</a>
</div>
I am trying to make it so that when I hover ANYWHERE over the wrapper div it changes the color of the shape AND link. So far I have only been able to manage individual hovers on the shape OR the link.
my CSS is:
.menu-circle {
width: 60px;
height: 60px;
background: black;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
margin:auto;
}
.menu-text{
font-family: 'Oswald', sans-serif;
font-weight:700;
letter-spacing: .07em;
}
.menu-circle:hover{
background:#e7e7e7;
}
.menu-text:hover{
color:#e7e7e7;
}
.menu-item{
text-align:center;
}
you can see the example here
If you want to change the colors when you hover ANYWHERE on the wrapper div then you must call the hover state on the wrapper dive. Like this:
mean-item:hover .menu-circle {change colors here}
This however would only change the circle when hovering anywhere in the wrapper div (the wrapper being menu-item) So you would need a second hover state for menu-text
mean-item:hover .menu-text {change colors here}
See here for working example:
http://jsfiddle.net/s6jkja5r/
Add this code to your style
menu-circle:hover ~ .menu-text{
color:#e7e7e7;
}
DEMO
Try this in your css:
.menu-item:hover div, .menu-item:hover span {
background:#e7e7e7;
color:#e7e7e7;
}
It was a minor CSS change.
.menu-item:hover .menu-circle {
background-color: #f4f;
}
.menu-item:hover .menu-text {
color: #f4f;
}
This fiddle should do exactly what you're trying to achieve:
http://jsfiddle.net/9qg3vjm3/10/
Check this fiddle
This changed css will change the background color of the circle div and the text color only while hovering on the circle div..
CSS
.menu-item:hover .menu-circle{
background:#e7e7e7;
}
.menu-item:hover .menu-text{
color:#e7e7e7;
}
HTML
<div class="menu-item">
<a href="#">
<div class="menu-circle"></div>
<span class="menu-text">Home</span>
</a>
</div>
I am having an issue with the submenu disappering for a website that I was asked to update and fix an issue (employee who created is no longer here). Admittedly I am not a UI person but trying to figure this out.
The menu options display and the submenu show when the user mouses over the parent menu item, however as soon as the mouse is moved to the submenu it then disappears. I upped the DisappearAfter tag to 9999. while the menu now displays I am not able to click on the menu item to navigate.
<div id="navigation-container" >
<div id="navigation" >
<asp:Menu ID="menuNavigation" StaticDisplayLevels="1" StaticSubMenuIndent="0" Orientation="Horizontal"
Font-Names="Arial, Gill Sans" runat="server" DynamicEnableDefaultPopOutImage="True"
StaticEnableDefaultPopOutImage="False" DisappearAfter="9999" DynamicHoverStyle-CssClass="navmenuitemhover"
StaticSelectedStyle-BackColor="Red">
<DynamicMenuStyle CssClass="headerzindex10" />
<LevelMenuItemStyles>
<asp:MenuItemStyle CssClass="navlevel1" />
<asp:MenuItemStyle CssClass="navlevel2" />
<asp:MenuItemStyle CssClass="navlevel3" />
</LevelMenuItemStyles>
</asp:Menu>
</div>
<asp:Label ID="lblOverview" runat="server" Text="Overview" CssClass="overviewLink" />
</div>
CSS Code:
#navigation-container
{
width: 100%;
color: #000;
top:60px;
position:fixed;
left:0px;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4B79BC, endColorstr=#355DAF);
BACKGROUND-COLOR: #4b79bc;
z-index:10;
}
#navigation
{
margin:0px;
position:fixed; /* This fixes the menu items issue*/
padding-left:5px;
z-index:10;
}
.navlevel1
{
color: white;
z-index:10;
top:35px;
padding:5px;
}
.navlevel2
{
color: black;
font-family: Gill Sans MT !important;
font-size: small;
background-color: #a5bcdd;
z-index:10;
top:35px;
}
.navlevel3
{
color: black;
background-color: #dbe4f1;
font-family: Gill Sans MT !important;
font-size: small;
z-index:10;
}
.navmenuitemhover
{
background-color:#253c5e;
color:White;
font-weight:bold;
z-index:10;
}
.headerzindex10
{
position:relative;
z-index:10;
}
Any help would be appreciated.
After many many searches, CSS edits, and re-doing the menu as a JQ Menu, i found that the line filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4B79BC, endColorstr=#355DAF); was causing the issue. Our company uses IE8 as the standard and we are locked down from upgrades.
Researching after the issue was found indicated that using filters in the CSS causes lots of issues in functionality and placement of elements and it is best not to use them.
The 2 options to fix was to use a background image repeated across the <DIV> or to remove and just use a solid color. since the menu bar area so small enough we just used the endColorstr for the menu and it blended nicely with the gradient for the header.
In IE7, my order sample button "#itmSampl" isn't vertically aligned with the ".add-to-cart" button to the left of it, although in FF3.6 and Chrome 5 it is. I need it to be aligned correctly in IE6-8. Does anyone see what I'm missing?
<style type="text/css">
#buttonbox { position:relative; width:326px; }
#accounting #box-accounting .image-item .content-account .add-to-cart { clear:both; margin:0 0 10px; }
#accounting #box-accounting .image-item .content-account
#ordrWizrd { float:left; height:24px; width:111px; }
#accounting #box-accounting .image-item .content-account .add-to-cart { clear:both; margin:0 0 10px; }
#itmSampl { bottom:0; cursor:pointer; display:block; height:24px; margin:0 3px 2px; position:absolute; right:0; width:120px; } .clearfix { clear:both; height:0; } </style>
<div id="buttonbox">
<div id="addtocart2" class="add-to-cart">
<table><%=getCurrentAttribute('item','addtocarthtml')%></table>
</div>
<div id="ordrWizrd" class="add-to-cart"><img src="/images/img/add-to-cart.gif" alt="configure item"></div>
<div id="itmSampl"></div>
</div> <div class="clearfix"></div> </div>
Also, here's the test page if a visual helps (you have to login to see the buttons instead of the bulleted list): http://www.avaline.com/85W_test_2
Login:test2#gmail.com
Pass:test03
Solution 1: Since you are already using a lot of tables in your page, another one won't hurt - just change your HTML from what you have above to something like this (may require a few tweaks):
<div id="buttonbox">
<div id="addtocart2" class="add-to-cart">
<table><tr>
<td><table><%=getCurrentAttribute('item','addtocarthtml')%></table></td>
<td valign="bottom"><div id="itmSampl"></div></td>
</tr></table>
</div>
<div class="clearfix"></div>
</div>
<!-- And also put #ordrWizrd in there somewhere -->
Solution 2: Take away all the "position: absolute" stuff with #itmSampl (remove the CSS bottom, position, right, and maybe margin and height/width properties). Then, add CSS float: right; margin-top: -36px; to #itmSampl to make it float on the right and move upward 36 pixels.