i used uib carousel in angular js ,for slide video in every 5 sec. for that used object element to embed video in that using vlc plugin.but porblem is that uib carousel have fixed height and width. how i change it and make it response.
if i use image in carousel that it simple to change height of it but when i used object tag than it not change the height .
i used it like this
<div ng-controller="CarouselDemoCtrl">
<div >
<uib-carousel interval="myInterval" no-wrap="noWrapSlides">
<uib-slide ng-repeat="slide in slides" active="slide.active">
<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab" id="vlc">
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" name="vlc" />
</object>
<div class="carousel-caption">
<h4>Slide {{$index}}</h4>
<p>{{slide.text}}</p>
</div>
</uib-slide>
</uib-carousel>
</div>
</div>
thank you.
change this lines from bootstrap.min.css to change height and width
before
.carousel { position: relative }
.carousel-inner { position: relative; width: 100%; overflow: hidden }
.carousel-inner>.item { position: relative; display: none; -webkit-transition: .6s ease-in-out left; -o-transition: .6s ease-in-out left; transition: .6s ease-in-out left }
.carousel-inner>.item>a>img, .carousel-inner>.item>img { line-height: 1 }
After
.carousel { position: absolute;height:100%;min-height: 100%;width:100%; }
.carousel-inner { position: relative; width: 100%; height:100%;min-height: 100%;}
.carousel-inner>.item {height:100%;min-height: 100%; position: relative; display: none; -webkit-transition: .6s ease-in-out left; -o-transition: .6s ease-in-out left; transition: .6s ease-in-out left;width:100%; }
.carousel-inner>.item>a>img, .carousel-inner>.item>img { line-height: 1 }
Related
I can't share a page on this, due to the page not being public. However, what I'm trying to do is create a hover effect on both a div and a H4 text element. Nothing of which seems to work for me. Here's my code:
HTML:
<div class="grid__item small--one-half medium-up--one-quarter">
<a href="/collections/hoop-earrings" class="collection-item collection-item--overlaid" data-aos="row-of-4"><div class="image-wrap">
<div class="collection-image collection-image--square lazyload" style='background-position: center center; background-image: url("https://cdn.shopify.com/s/files/1/1810/9951/collections/LDE42DSOS_Hexagon_Hoop_Earring_web_scroll_1200x_ad647924-a6b9-4c9a-b36a-7d6a3b0d0a6c_720x.jpg?v=1561755337");'>
</div>
</div>
<noscript>
<div
class="collection-image collection-image--square"
style="background-image: url(//cdn.shopify.com/s/files/1/1810/9951/collections/LDE42DSOS_Hexagon_Hoop_Earring_web_scroll_1200x_ad647924-a6b9-4c9a-b36a-7d6a3b0d0a6c_400x.jpg?v=1561755337); background-position: center center;">
</div>
</noscript>
<div class="collection-image--overlay-background"></div>
<span
class="collection-item__title collection-item__title--overlaid collection-item__title--heading collection-item__title--center">
<span>
Text Goes Here
</span>
</span>
</a>
</div>
CSS:
.collection-image--overlay-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #fff;
opacity: 0;
-webkit-transition: opacity 1s linear;
-moz-transition: opacity 1s linear;
-ms-transition: opacity 1s linear;
-o-transition: opacity 1s linear;
transition: opacity 1s linear;
}
.collection-item__title.collection-item__title--overlaid.collection-item__title--heading.collection-item__title--center {
opacity: 0!important;
-moz-transition: opacity .25s linear;
-webkit-transition: opacity .25s linear;
-o-transition: opacity .25s linear;
transition: opacity .25s linear;
}
#media only screen and (min-width: 768px) {
.collection-image--overlay-background:hover {
z-index: 1;
opacity: .8;
}
.collection-item__title.collection-item__title--overlaid.collection-item__title--heading.collection-item__title--center:hover {
z-index: 1;
opacity: 1;
}
}
I tried making a small snippet. See if it´s what you´re looking for.
Since you´re using the !important flag in one of your opacity rules, all the other changes after the fact will not take effect unless you also use !important. However I would not advice using !important that freely because whenever they are present such errors are a bit harder to track.
.container {
background-color: blue;
height: 100px;
}
.onHover {
background-color: red;
width: 80%;
height: 100px;
margin: 0 auto;
opacity: 0.5;
/*opacity: 0.5 !important; In your code you have
a line like this.*/
}
.onHover:hover {
opacity: 1;
}
<div class="container">
<div class="onHover">
<h4>My title Here</h4>
</div>
</div>
I have a web page containing 3 images. When I hover over my mouse on any of the image, its width and height increase and z-index changes(it comes on top of other images). The problem is that as soon as I move my mouse out of the image div, its z-index changes immediately i.e the other two images gets on top. I want the image to be on top both when it is increasing in size and when it is decreasing in size.
Here is my CSS:
div {
position: fixed;
width: 100px;
height: 100px;
transition: width 2s, height 2s;
}
div.image1 {
top: 10px;
transition-timing-function: linear;
content:url("http://freedwallpaper.com/wp-content/uploads/2014/03/4-Nature+Wallpapers+2014-1.jpg");
}
div.image2 {
top: 120px;
transition-timing-function: linear;
content:url("http://stylonica.com/wp-content/uploads/2014/02/nature.jpg");
}
div.image3 {
top: 230px;
transition-timing-function: linear;
content:url("http://feelgrafix.com/data_images/out/2/748315-beautiful-nature-wallpaper.jpg");
}
div:hover {
z-index: 1;
width: 800px;
height: 800px;
}
Something like this:
<!DOCTYPE HTML>
<html>
<head>
<title>Test</title>
<style>
div {
position: fixed;
width: 100px;
height: 100px;
transition: z-index 2s, width 2s, height 2s;
}
.image1, .image2, .image3{
z-index: 1;
}
div.image1 {
top: 10px;
transition-timing-function: linear;
content:url("http://freedwallpaper.com/wp-content/uploads/2014/03/4-Nature+Wallpapers+2014-1.jpg");
}
div.image2 {
top: 120px;
transition-timing-function: linear;
content:url("http://stylonica.com/wp-content/uploads/2014/02/nature.jpg");
}
div.image3 {
top: 230px;
transition-timing-function: linear;
content:url("http://feelgrafix.com/data_images/out/2/748315-beautiful-nature-wallpaper.jpg");
}
div:hover {
z-index: 10;
width: 800px;
height: 800px;
}
</style>
</head>
<body>
<div class="image1"></div>
<div class="image2"></div>
<div class="image3"></div>
</body>
</html>
1) Add the transition: all 2s rule to the div:hover class as well.
2) You haven't explicitly stated z-index=0 in the div class.
3) Plus, you've missed out animating your z-index in the div class as well, which is why I prefer the transition: all 2s;style.
I'm trying to make a child div (.imagehead) slide to the left (about 25%) on hover of the parent div (#bite) and reveal another div (Name not decided, but I want it to be 2-3 lines of text) to the right of (.imagehead), relative to where (.imagehead) is.
I haven't coded in a while, sorry if this is extremely simple and I just can't solve this.
Here is the code itself (a tumblr theme I'm messing with)
<div id="headbox">
<div class="top">
<div class="nav">
<div align="center">
<BR/>
<BR/>
<div class="headimage"><img src="http://s24.postimg.org/gqgjloln9/head.png"></div>
<div id="transitiontext">I want to show this when "headbox" is hovered on, moving "headimage" to the left 25% and revealing this text next to it</div>
<BR/>
<BR/>
</div>
</div>
</div>
#headbox {
top: 30px;
}
#headbox:hover .headimage {
left: 25%;
}
http://jsfiddle.net/bko87pk9/
The image is made position: absolute to remove it from the normal flow. The text will now display underneath.
The nav container is made position: relative so that its absolute children will position themselves in relation to it and not the body
The image is moved on hover and the transition creates a smooth animation to display the text
Examples
Example 1
In this example, the text needs to be contained in a box the same height and width of the image so it does not peek out from underneath.
.nav {
height: 100px;
position: relative;
}
.headimage {
position: absolute;
transition: left 0.5s;
left: 0;
}
.nav:hover .headimage {
left: 25%;
}
.transitiontext {
width: 25%;
}
<div class="nav">
<img class="headimage" src="http://s24.postimg.org/gqgjloln9/head.png">
<div class="transitiontext">This text needs to be contained properly.</div>
</div>
Example 2
In this example, the text can spill out underneath as it will be hidden with opacity: 0. On hover the opacity is changed to opacity: 1 with a smooth transition.
The opacity value changes the z-value of the text div, so we need to declare z-index values (higher will display on top of lower)
pointer-events: none prevents the hover from activating when hovering the hidden text.
.nav {
height: 77px;
/* height of image */
position: relative;
}
.headimage {
position: absolute;
transition: left 0.5s;
left: 0;
z-index: 2;
}
.nav:hover .headimage {
left: 25%;
}
.transitiontext {
width: 25%;
transition: opacity 0.5s;
opacity: 0;
z-index: 1;
pointer-events: none;
}
.nav:hover .transitiontext {
opacity: 1;
}
<div class="nav">
<img class="headimage" src="http://s24.postimg.org/gqgjloln9/head.png">
<div class="transitiontext">This text does not need to be contained as it will be hidden until the hover state is activated. This text does not need to be contained as it will be hidden until the hover state is activated.</div>
</div>
I am sorry for any not working code, I crested this on my phone.
<div id="test">
Hover on this div.
</div>
#test {
height: 100px;
width: 200px;
background-color: #F1F1F1;
-webkit-transition:
all 1s ease-in-out
all 1s linear;
-moz-transition:
all 1s ease-in-out
all 1s linear;
-ms-transition:
all 1s ease-in-out
all 1s linear;
-o-transition:
all 1s ease-in-out
all 1s linear;
transition:
all 1s ease-in-out
all 1s linear;
}
#test:after {
height: 100px;
width: 200px;
content: "Second div.";
display: none;
background-color: #F9F9F9;
position: absolute;
top: 0px;
left: 210px;
}
#test:hover:after {
display: block;
}
Im trying to overlay another image over an image whenever someone toggles the hover state.
How can I show the second image?
<img src="my-image-url" />
Here you go, Image shows up when you hover the div:
Example : jsFiddle
HTML:
<div> <img src="http://img122.imageshack.us/img122/1512/spiderman4teaserwo2.jpg" />
</div>
CSS:
div:hover img{
opacity: 1;
}
img{
position: relative;
width :100%;
height: 100%;
opacity: 0;
-webkit-transition: all 300ms ease-in-out;
-moz-transition: all 300ms ease-in-out;
transition: all 300ms ease-in-out;
}
DEMO: http://jsfiddle.net/pDeKy/1/
HTML
<a href="#">
<img src="http://placekitten.com/200" />
<img src="http://placekitten.com/100" class="hovery" />
</a>
CSS
a {
position: relative;
}
/* Make our images sit on top of one and other */
a img {
position: absolute;
}
.hovery {
display: none;
}
a:hover .hovery {
display: block;
}
I'm having trouble finding a solution to this problem.
I have set up this small example here.
Google Chrome seems to break the border radius on :hover while Firefox renders it properly. What would be the correct approach to fix this?
position:relative in .bubble is probably the thing breaking it, if that's so is there any other solution to have the .info absolute position div nested to the .bubble so top: would use the top of the .bubble and not the page?
HTML:
<div class="bubble">
<img src="http://oneslidephotography.com/wp-content/uploads/2009/05/Digital-SLR-Photography-All-in-One-For-Dummies-sample-image.jpg" />
<div class="info">
<h3>Some Info Text</h3>
</div>
</div>
CSS:
.bubble {
position: relative;
float: left;
width: 200px;
height: 200px;
border-radius: 50%;
overflow: hidden;
}
.info {
overflow: hidden;
position: absolute;
width: inherit;
-webkit-transition: top 0.2s ease-out;
-moz-transition: top 0.2s ease-out;
-o-transition: top 0.2s ease-out;
-ms-transition: top 0.2s ease-out;
transition: top 0.2s ease-out;
top:200px;
}
.bubble:hover .info {
top:80px;
}
.info h3{
text-align: center;
font-family: sans-serif;
}
I think the problem is the fact that you have an image taking up your whole background.
I've changed it so that you don't have an image (and reduced the border radius) ... so just basic border-radius, and of-course, things are fine:
<div class="bubble" style='border:solid 1px'>
<div class="info">
<h3>Some Info Text</h3>
</div>
</div>
http://jsfiddle.net/SbR6n/
Sounds like a bug.