BS3 carousel + animate.min.css not working perfectly in Firefox - html

I am using firefox 33.0 in Ubuntu 14.04. I have a website(localhost) with bootstrap 3 carousel. I have applied "animated pulse" (animate.min.css) class to my "img" in the "class=item" div and "animated fadeinleft" to my carousel-caption.
<div class="item">
<img src="images/2.jpg" class="img-responsive animated pulse">
<div class="container">
<div class="carousel-caption">
<h1 class="animated fadeinleft">Another example headline.</h1>
<p class="animated fadeinright">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
</div>
</div>
</div>
There are 3 slides in total. For the first appearance of each slide, the image and carousel caption comes with the effect (animate.min.css). But after that the slides just comes and goes without any effect. This happens only in firefox. In Chrome 38.0.2125.104 it works as expected. Somebody please suggest a way to fix the issue.

If you look at the example on their site the classes are applied and if you want to trigger again you need to remove and add classes again. That is how CSS3 animation is restarted or triggered again by removing and adding classes again. You can read more about this here. In your case the classes are not removed and added again.
For Bootstrap you can use the slide.bs.carousel where you can add the classes again. I have added a data attribute [data-animation] to the elements for the respective animation.
<div class="active item">
<img src="http://lorempixel.com/1024/750" alt="Slide1" class="img-responsive animated pulse" data-animation="pulse" />
<div class="container">
<div class="carousel-caption">
<h1 class="animated fadeInLeft" data-animation="fadeInLeft">Another example headline.</h1>
<p class="animated fadeInRight" data-animation="fadeInRight">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
</div>
</div>
</div>
JS code
function animateElement(obj, anim_) {
obj.addClass(anim_ + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
$(this).removeClass();
});
}
$('#myCarousel').on('slide.bs.carousel', function (e) {
var current = $('.item').eq(parseInt($(e.relatedTarget).index()));
$('[data-animation]').removeClass();
$('[data-animation]', current).each(function () {
var $this = $(this);
var anim_ = $this.data('animation');
animateElement($this, anim_);
});
});
Fiddle Demo

Related

How to overlay border over cover image in Bootstrap?

I am having troubles rendering a bordered area on top of the cover image on my web page. The contents of the bordered area display above the image but the border and background does not show up.
The borders are supposed to look like this:
I want the same experience for the cover photo so it covers half of the photo but also has the solid background.
Here is some of the relevant code below. If someone could give me some guidance as to how to properly layer these on top of each other that would be fantastic.
CompanyProfile.js:
class CompanyProfile extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<CoverPhoto/>
<div className="container-fluid page">
<ProfileHeader/>
ProfileHeader.js:
const ProfileHeader = (props) => {
return (
<div className="row border rounded-top p-2 bg-white" style={{marginTop: '5px'}}>
<div className="col-lg-2">
<img className="rounded-circle text-center" id="companyProfile" src={github}/>
<h5 className="mt-2" id="nameLabel">Github</h5>
</div>
<div className="col-lg-2">
<h6 className="mt-2" style={{marginBottom: '0px'}}><strong>Website</strong></h6>
<a className="" href="http://github.com" target="_blank">http://github.com</a>
<h6 className="mt-2" style={{marginBottom: '0px'}}><strong>Company Size</strong></h6>
<span className="">800 employees</span>
<h6 className="mt-2" style={{marginBottom: '0px'}}><strong>Year Founded</strong></h6>
<span className="">2008</span>
</div>
<div className="col-lg-8">
<h6 className="ml-3 mt-2" style={{marginBottom: '0px'}}><strong>About</strong></h6>
<p className="ml-3" style={{wordWrap: 'break-word'}}>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut enim dolor, bibendum non eros ut, aliquet tristique eros. Suspendisse potenti. Cras lobortis condimentum magna, ut vehicula turpis dapibus sit amet. Pellentesque hendrerit ultricies massa, a mattis purus rhoncus mollis. Mauris egestas leo id mauris euismod maximus. Proin feugiat tincidunt laoreet.</p>
</div>
</div>
)
}
CoverPhoto.js:
import React from 'react';
import coverPhoto from './images/coverphoto.jpg';
const CoverPhoto = () => {
return <img src={coverPhoto} style={{width: '100%', maxHeight: '400px'}}/>
}
export default CoverPhoto;
It might be an issue with z-index.
Try adding style={{ z-index: 9999 }} to the element that you want on top of the other. And see if that works.
if you add bootstrap cdn to you project just add clearfix class before this div
<div className="clearfix"/>
<div className="container-fluid page">
https://getbootstrap.com/docs/4.3/utilities/clearfix/

Cant figure out where IMG is

Hi i'm working with a new template, and there's a main image on the landing page.
photo
It's the photo behind the main text. I cannot figure out where the img source is.
I don't see it in the HTML. I just would like to find where this stock image is and swap my new image into its place.
I'm pretty sure the following code is where it should be:
<!-- home -->
<section aria-label="home" class="mainbg" id="home">
<!-- intro -->
<div class="container">
<div class="row">
<div class="overlay-main v-align">
<div class="col-md-10 col-xs-11">
<h1 class="onStep" data-animation="animbouncefall" data-time="300">LOUIS WALLACE CONSTRUCTION</h1>
<div class="onStep" data-animation="fadeInUp" data-time="600" id="slidertext">
<h3 class="main-text">We Build Your Dream</h3>
<h3 class="main-text">We Are Passionate</h3>
<h3 class="main-text">We Are Capable</h3>
</div>
<p class="onStep" data-animation="animbouncefall" data-time="900">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sit amet eas malesuada leo. Vestibulum eros magna volutpat at facilisis cursus, tempus etex Vestibulum pellentesque et dolor sit amet. Pellentesque eu enim nec nibh convallis suscipit. Morbi interdum dignissim metus dignissim gravida.
</p>
</div>
</div>
</div>
</div>
<!-- intro end -->
</section>
<!-- home end -->
Is there some way it could be in the css?
Edit: when I inspect it, first of all I'm not entirely sure which one is for the image. In any case, when I select what I think is the right element, the styles area don't point to any img tag.
It's more than likely being displayed as a background using the mainbg css class. Can you look in your stylesheet for mainbg?

Each div lower than the previous one, no margin or padding issue

Creating a custom WordPress theme with Bootstrap3.
My divs are behaving ridiculous, as I probably missed something. I tried various solutions like display: inline, vertical-align: top, floats and clears, etc... But nothing worked.
Here is my current look, and everything should be inline:
here is my current code:
<div class="container content">
<!-- CONTENT -->
<div class="col-md-12 blog-posts">
<article class="single-article col-md-4">
<a href="myweb.com/blog/tempus-non-auctor/">
<img width="300" height="300" src="myweb.com/wp-content/uploads/2016/07/team4-300x300.jpg" class="img-responsive wp-post-image" alt="team4" srcset="myweb.com/wp-content/uploads/2016/07/team4-300x300.jpg 300w, myweb.com/wp-content/uploads/2016/07/team4-150x150.jpg 150w, myweb.com/wp-content/uploads/2016/07/team4.jpg 573w" sizes="(max-width: 300px) 100vw, 300px"> </a>
<h1 class="article-headline">tempus non, auctor</h1>
<h4 class="article-time-stamp"><i>Posted on July 15th, 2016</i></h4>
<p></p><p>Etiam sit amet orci eget eros faucibus tincidunt. In hac habitasse platea dictumst. Aenean commodo ligula eget dolor. Vivamus in erat ut urna cursus vestibulum. Vestibulum facilisis, purus nec pulvinar iaculis, ligula mi congue nunc, vitae euismod ligula urna in dolor. Fusce fermentum. Etiam feugiat lorem non metus. Suspendisse feugiat. Praesent congue erat at massa.<br><a class="moretag hvr-pop" href="myweb.com/blog/tempus-non-auctor/"><i>Read more</i></a></p>
<p></p> </article>
</div> <!-- end blog posts part -->
<!--END content wrapper -->
</div>
and css:
.single-article {
padding-bottom: 10%;
em {
font-style: italic;
}
}
.article-headline {
padding-bottom: 2%;
a {
color: $purple-color;
}
}
.article-time-stamp {
font-size: 1em;
padding-bottom: 1%;
}
Any advices? Thanks
You have col-md-4 nested right under col-md-12. You can't nest columns like that. You need a row in between. That is improper Bootstrap.
<div class="row">
<div class"col-md-12">
<div class="row">
<div class="col-md-4">
<p>Blah Blah</p>
</div>
<div class="col-md-4">
<p>Blah Blah</p>
</div>
<div class="col-md-4">
<p>Blah Blah</p>
</div>
</div>
</div>
</div>
If you are using inline-block, make sure that you have this CSS declaration:
vertical-align: top
This way everything gets aligned at the top of the div. You can always use margins or padding to push things down if you need to.
Hope this fixes what you need!
sometimes the easiest solution is the most logical one.
I've found out that I had a <br> tag under each article and this was causing that each article is being pushed down.

:last-child is not working

This is my first post here, so please tell me, if I'm doing something wrong.
I have a problem with the following code:
That's my HTML:
<div class="sideSection">
<div class="sidebar">
<div class="mainContainer">
<div class="articleHeader">
<h3>Sapien lorem tempus</h3>
<h4>Pharetra sed bibendum lorem</h4>
</div>
<p>Nunc cursus quam vitae ipsum viverra luctus. Nam nullam feugiat massa lacinia lectus vitae. Sed eu turpis at adipiscing.</p>
<div class="sidebarBox">
<img src="images/pic04.jpg" alt="ernster Blick">
<div class="sidebarBoxText">
Cursus quam vitae
<p>Nunc cursus quam vitae ipsum viverra luctus sapien.</p>
</div>
</div>
<div class="sidebarBox">
<img src="images/pic05.jpg" alt="Straße">
<div class="sidebarBoxText">
Etiam at orci ut nibh
<p>Nunc cursus quam vitae ipsum viverra luctus sapien.</p>
</div>
</div>
<div class="sidebarBox">
<img src="images/pic06.jpg" alt="telefonierender Blick">
<div class="sidebarBoxText">
Mauris non tellus
<p>Nunc cursus quam vitae ipsum viverra luctus sapien.</p>
</div>
</div>
<div class="sidebarBox">
<img src="images/pic07.jpg" alt="Skyscraper">
<div class="sidebarBoxText">
Duis id ipsum
<p>Nunc cursus quam vitae ipsum viverra luctus sapien.</p>
</div>
</div>
<div class="moreInfoButton">More Info</div>
</div>
</div>
</div>
And here is my CSS:
.sideSection .sidebar,
.sideSection .sidebar .sidebarBox {
float: left;
}
.sideSection .sidebar .sidebarBox {
padding: 25px 0px 20px;
border-bottom-style: solid;
border-width: 1px;
border-color: #ccc;
}
.sideSection .sidebar .sidebarBox:last-child {
border: none;
}
Now, what I'm trying to do, is to remove the border from the last "sidebarBox" class.
This isn't quite working out yet, because the code isn't affecting the border at all. I don't really know what I'm doing wrong, and I hope that someone can help me here, as it is for work :S
EDIT: Okay, as far as I figured it out by now, it's a problem with the s.
When I use "".sidebarBox:nth-child(6)"" it works just fine..
Does the ":last-child" attribute actually count all s that I used in that section?
:last-child only matches the actual last child of the parent div.
You have the .moreinfoButton following it. If you can move the button to outside the .mainContainer, it will work as you expect it
The :last-child selector applies to the last element inside a parent div. In your case the parent div is .mainContainer and its last child is .moreInfoButton and not .sidebarBox.
I would recommend you to add last class to the sidebarBox you want to modify, i.e.
<div class="sidebarBox last">
and the corrspondent css code is
.sideSection .sidebar .sidebarBox.last {
border: none;
}
Or another way to handle it is to wrap all your .sidebarBox elements in one parent <div>. Then you would be able to use :last-child selector.

text-shadow applying to all the text on website?

So i have this weird problem if it's even a problem(?) might just be me who doesn't understand CSS and how it works
i created a css class called textShadow
.textshadow {
text-shadow: 1px 1px 0px #000000;
}
and when i added it to en element suddenly all the text had the same text-shadow is it supposed to be like this?
if you add text-shadow with
style="text-shadow: 1px 1px 0px #000000;"
only the specefide element gets text-shadow
Thank you for reading my post and happy holidays!
EDIT: Adding some html code
<div class="w-container">
<div class="w-slider w-hidden-tiny headerslider" data-animation="slide" data-duration="500" data-infinite="1" data-delay="4000" data-autoplay="1">
<div class="w-slider-mask">
<div class="w-slide headerSliderContentPadding" style="text-align: center">
<h1 class="textOnDark1 textshadow">Suspendisse varius enim in eros elementum tristique!
</h1>
<h4 class="w-hidden-tiny w-hidden-small textOnDark1 textshadow">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.
</h4>
<div class="w-hidden-main w-hidden-medium" style="display: inline-block; margin-left: auto; margin-right: auto;">
<a class="buttonBlue btn extraPaddíng10px" href="#">Button Text</a>
</div>
</div>
<div class="w-slide">
</div>
<div class="w-slide">
</div>
</div>
<div class="w-slider-arrow-left">
<div class="w-icon-slider-left"></div>
</div>
<div class="w-slider-arrow-right">
<div class="w-icon-slider-right"></div>
</div>
<div class="w-slider-nav w-round w-num"></div>
</div>
</div>
I only want the elements that have the textshadow class to have text-shadow, but all the element get's text-shadow when i run it in chrome, firefox and internet explorer (even the div slider get's shadowing) why is that?
After some html inspection i found that the class had for some reason been applied to the <html> tag(?)
and some other weird classes as well i guess it have to do something with how webflow works (forgot to mention that the website was created with webflow) why it dose this i have no idé but at least i know why now :)
Thanks for all the suggestions and help guys you are great