Collapsing button's class changes when item is collapsed or not - html

sorry for this code but I'm just beginning developing and don't know at all where is the trigger for what I want.
so what I am looking for :
I already achieved that when I click on a button, the area connected to it shows and the 2 others collapse.
What I don't know, is HOW I can change the class of the button (from fa-angle-right to fa-angle-down) when my area is shown and get back to the default when collapsed...
here is my HTML :
<section id="mes-creations" class="mes-creations text-center">
<div class="mes-creations">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h2 id="titre-section">section title</h2>
<p>section description</p>
</div>
</div>
<!--bouttons-->
<div class="row">
<p>
<div class="col-sm-4 col-md-4 col-lg-4">
<a class="btn btn-primary stylebtn collapsed" id="bouton-1" data-toggle="collapse" data-parent="#accordeon" href="#collapseGallery1" aria-expanded="false" aria-controls="collapseGallery1">
<span class="fa fa-angle-right animated"> bouttontitle1</span>
</a>
</div>
</p>
<p>
<div class="col-sm-4 col-md-4 col-lg-4">
<a class="btn btn-primary stylebtn collapsed" id="bouton-2" data-toggle="collapse" data-parent="#accordeon" href="#collapseGallery2" aria-expanded="false" aria-controls="collapseGallery2">
<span class="fa fa-angle-right animated"> boutontitle2</span>
</a>
</div>
</p>
<p>
<div class="col-sm-4 col-md-4 col-lg-4">
<a class="btn btn-primary stylebtn collapsed" id="bouton-3" data-toggle="collapse" data-parent="#accordeon" href="#collapseGallery3" aria-expanded="false" aria-controls="collapseGallery3">
<span class="fa fa-angle-right animated"> boutontitle3</span>
</a>
</div>
</p>
</div>
<!--end button-->
<!--gallery-->
<p>
<div class="row" id="accordeon">
<div class="gallery-custom row collapse" id="collapseGallery1">
<div class="col-xs-6 col-sm-4 col-md-3"><img class="img-gallery-style" src="img/Banniere/11-fleurs.png" alt="Banniere1"></div>
<div class="col-xs-6 col-sm-4 col-md-3"><img class="img-gallery-style" src="img/Banniere/Annees-80.png" alt="Banniere2"></div>
<div class="col-xs-6 col-sm-4 col-md-3"><img class="img-gallery-style" src="img/Banniere/Banniere-robo.gif" alt="Banniere3"></div>
<div class="col-xs-6 col-sm-4 col-md-3"><img class="img-gallery-style" src="img/Banniere/banniere-site-2012.png" alt="Banniere4"></div>
<div class="col-xs-6 col-sm-4 col-md-3"><img class="img-gallery-style" src="img/Banniere/Collection-western.png" alt="Banniere5"></div>
<div class="col-xs-6 col-sm-4 col-md-3"><img class="img-gallery-style" src="img/Banniere/Beyblade-Film-V1G.png" alt="Banniere6"></div>
</div>
<div class="gallery-custom row collapse" id="collapseGallery2">
<div class="col-xs-4 col-sm-3 col-md-3"><img class="img-gallery-style" src="img/CP/Camelot-CP.png" alt="CP1"></div>
<div class="col-xs-4 col-sm-3 col-md-3"><img class="img-gallery-style" src="img/CP/CP-Groupe-delite-Final.png" alt="CP2"></div>
<div class="col-xs-4 col-sm-3 col-md-3"><img class="img-gallery-style" src="img/CP/CP-guerre-des-empires.png" alt="CP3"></div>
<div class="col-xs-4 col-sm-3 col-md-3"><img class="img-gallery-style" src="img/CP/CP-GUERRIERE_ZYLO.png" alt="CP4"></div>
<div class="col-xs-4 col-sm-3 col-md-3"><img class="img-gallery-style" src="img/CP/CP-MAntera-copie.png" alt="CP5"></div>
<div class="col-xs-4 col-sm-3 col-md-3"><img class="img-gallery-style" src="img/CP/CP-OFF-WHITE-LIES_ZYLO2.png" alt="CP6"></div>
</div>
<div class="gallery-custom row collapse" id="collapseGallery3">
<div class="col-xs-6 col-sm-6 col-md-6"><img class="img-gallery-style" src="img/Print/BLACKS-GAME-ANNEES-LASER.png" alt="Print1"></div>
<div class="col-xs-6 col-sm-6 col-md-6"><img class="img-gallery-style" src="img/Print/BLACKS-GAME-MADMOVIES.png" alt="Print2"></div>
<div class="col-xs-6 col-sm-6 col-md-6"><img class="img-gallery-style" src="img/Print/print-2013-final.png" alt="Print3"></div>
<div class="col-xs-6 col-sm-6 col-md-6"><img class="img-gallery-style" src="img/Print/Print-Line-Up-Final.png" alt="Print4"></div>
</div>
</div>
</p>
</div>
</div>
</section>
and my js :
$('#accordeon').on('show.bs.collapse', function () {
$('#accordeon .in').collapse('hide');
});
Demo

Here's a somewhat hackish way to do it. It would be simpler if you were using markup structure closer to what Bootstrap suggests.
$('.stylebtn').click(function() {
$(this).find('.fa').toggleClass('fa-angle-down fa-angle-right')
.closest('div').siblings().find('.fa')
.removeClass('fa-angle-down').addClass('fa-angle-right');
});
Demo

Related

Bootstrap columns not working on ios devices as they should

I have made a card using bootstrap. The columns work fine in all the devices. But they completely change in any ios devices. Screenshot attached.
http://projecttesting.tk/sfl/test.html
is my card on test server.
Fiddle: https://jsfiddle.net/Lhjm8ztn/
<section class="card__list row">
<div class="card__box col-md-12 col-sm-12">
<div class="card">
<div class="card__content">
<div></div>
<div class="ribbon"><span>Sponsored</span></div>
<div class="row card__bottom2">
<div class="col-6 col-sm-4 col-md-8 contest">
<img src="index.png" width="25px" height="25px"> <span class="card__title">MyTeam11</span>
<div class="date2">
<span class="time"> (2 Minutes Ago) </span>
</div>
</div>
<div class="col-3 col-sm-4 col-md-2 center3 card__price">
<span class="card__title">66%</span>
<div class="date">
Overlay
</div>
</div>
<div class="col-3 col-sm-4 col-md-2 center3 card__price">
<span class="card__title">25%</span>
<div class="date">
Margin
</div>
</div>
</div>
<div class="row card__bottom">
<div class="col-6 col-sm-4 col-md-4 col-lg-2 left options">
<span class="date weight">
1.6 Million Monster
</span>
<div class="date2">
43.6 % Overlay
</div>
</div>
<div class="col-6 col-sm-4 col-md-4 col-lg-2 center card__price">
<span class="date weight"> ₹ 1600000</span>
<div class="date2">
Prizepool
</div>
</div>
<div class="col-6 col-sm-4 col-md-4 col-lg-2 right left2 card__price">
<span class="date weight"> 55555</span>
<div class="date2">
Max Entries
</div>
</div>
<div class="col-6 col-sm-4 col-md-4 col-lg-2 left center2 card__price">
<span class="date weight"> ₹ 35</span>
<div class="date2">
Entry Fee
</div>
</div>
<div class="col-6 col-sm-4 col-md-4 col-lg-2 center left2 card__price">
<progress id="pb0" value="620" max="1760"></progress>
<div class="date2">
620/1760 Joined
</div>
</div>
<div class="col-6 col-sm-4 col-md-4 col-lg-2 center2 right card__price">
<div class="date2">
<button type="button" class="btn btncs btn-primary">Join Now</button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
I have tried to change the display property but it was not helpful.
add below code at the end of your css code i hope this should work in ios all sizes
#media(min-width:320px) and (max-width:1024px){
.left2 {
text-align: left !important;
}
.card__price {
text-align: right !important;
}
.left2 {
text-align: left !important;
}
}

How align horizontal items?

I want to align these elements in mobile view
I want that on mobile devices the images are on top of the text and not on the side.
<div class="container">
<div class="row vcenter">
<div class="col-xs-12 col-sm-6 col-md-2">
<h3>Why Us?</h3>
</div>
<div class="col-xs-12 col-sm-6 col-md-10 items_why">
<div class="col-xs-12 col-sm-6 col-md-3">
<img src="/assets/img/icons/destination_expert.png">
<span>Destination Expert</span>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<img src="/assets/img/icons/faster.png">
<span>Faster</span>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<img src="/assets/img/icons/transparent.png">
<span>Transparent</span>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<img src="/assets/img/icons/cheaper.png">
<span>Cheaper</span>
</div>
</div>
</div>
</div>
The <div>s containing <span>s should be contained in another row so they can be part of another grid within the grid.
<div class="container">
<div class="row vcenter">
<div class="col-xs-12 col-sm-12 col-md-2">
<h3>Why Us?</h3>
</div>
<div class="col-xs-12 col-sm-12 col-md-10">
<div class="row">
<div class="col-xs-12 col-md-1">
<img src="/assets/img/icons/destination_expert.png">
</div>
<div class="col-xs-12 col-md-2">
<span>Destination Expert</span>
</div>
<div class="col-xs-12 col-md-1">
<img src="/assets/img/icons/faster.png">
</div>
<div class="col-xs-12 col-md-2">
<span>Faster</span>
</div>
<div class="col-xs-12 col-md-1">
<img src="/assets/img/icons/transparent.png">
</div>
<div class="col-xs-12 col-md-2">
<span>Transparent</span>
</div>
<div class="col-xs-12 col-md-1">
<img src="/assets/img/icons/cheaper.png">
</div>
<div class="col-xs-12 col-md-2">
<span>Cheaper</span>
</div>
</div>
</div>
</div>
</div>
You can try it here: https://www.bootply.com/new

How to make two Div fixed with respect toeach other?

I have a Div below which is a button and as my screensize changes height of the Div changes due to which the button changes its position sometimes it hides behind the Div as I have provided z-index. How can I make position of the button fixed with respect to the Div even when the screensize changes?
Here is my HTML code:--
<div class="row" id="event">
<div class="col-lg-1 col-md-1 col-xs-1"></div>
<div class="col-lg-10 col-md-10 col-xs-10 ">
<section *ngFor="let event of events; let i = index" [style.backgroundColor] = "colorsArray[i]" class="eventSectionCSS">
<legend class="legendCSS"> {{event.title}}</legend>
<br>
<div class="row" style="margin-left: 15px;" >
<div class="col-lg-6 col-md-6 col-xs-6" style="display: inherit;" >
<div class="row" >
<div class="col-md-6 col-lg-6 col-sm-6 col-xs-6">
<h2 class="presenterNameCSS" >{{ event.SMEPresentedByFirstName | uppercase}} </h2>
</div>
<div class="col-md-6 col-lg-6 col-sm-6 col-xs-6" style="margin-left: -10px;" >
<h2 class="presenterNameCSS" > {{ event.SMEPresentedByLastName | uppercase}} </h2>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3" ></div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3" id="image__event_both" >
<div class="col-lg-6 col-md-6 col-xs-6">
<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front">
<img id="image__1" (click) = "clickToShare()" src="../assets/img/Fwd Icons/share.png" >
</div>
<div class="back">
<div class="row" >
<section class="widget sharing_events_widget">
<share-buttons (click) = "closeShareIt(i)" [url]="'http://mentoriaweb.azurewebsites.net/#/app/Login'"
[count]="false"
[totalCount]="true"
[defaultStyle]= "true"
(popUpClosed) = "true"
[google]="googleInner"
[pinterest]="false"
[linkedIn]="false"
[tumblr]="tumblrInner"
[reddit]="false"
[stumbleUpOn]="false">
</share-buttons>
</section>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-xs-6">
<img id="image__2" (click) = "notifyMe(event.uid)" src="../assets/img/Fwd Icons/notify.png" >
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 presenterImageDivCSS " >
<img style="margin-left: 31px;" src="assets/img/avatar.png">
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<p class="smeSnippetCSS" > {{event.snippet}} </p>
<a style="color:#fff;" >...Read more</a>
</div>
<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 dashed_height"style="">
<div class="date1" >{{event.eventDate*1000 | date:'dd'}}</div>
<div class="date2"><b>{{event.eventDate*1000 | date:'MMM' | uppercase}}</b> <br>
<p class="date3">{{event.eventDate*1000 | date:'yyyy'}}</p>
</div>
<div class="date4"> <b>{{ event.eventDate | date:'hh:mm a'}}</b></div>
</div>
</div>
<br>
</section>
<div>
<button class="btn btn-primary width-100 mb-xs" id="sme_register" role="button" ><span class="sme_buttonn"><b> Register</b></span> </button>
</div>
</div>
<div class="col-md-1 col-lg-1 col-xs-1"></div>
</div>
You can achieve this by using position relative. Position fixed is respective to the screen.
The fiddle you updated is not showing what actually are upto. I can't see position fixed on button.

Website content

I've tried many ways to code but none of them works. The 3 products are listed vertically in one column. But I have no idea on how to separate the the following <div> containing 6 others product into different columns beside it. Can you help me to solve this?
Or, in other ways, can the <div> is actually aligned into 3 products per row, not in column?
<div class="products-right-grids-position1">
<h4>BUN BOY Bakery</h4>
<p>Best Bakery in Town </p>
<p> </p>
</div>
</div>
</div>
<div class="products-right-grids-bottom">
<div class="col-md-4 products-right-grids-bottom-grid">
<?php
echo getPros();
?>
<?php
echo getBreadPros();
?>
</div>
<div class="clearfix"> </div>
</div>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<div class="container-fluid">
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
About
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<img src="https://www.google.ca/images/srpr/logo11w.png" style="width: 100px">
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
SHARE
</div>
</div>
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
About
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<img src="https://www.google.ca/images/srpr/logo11w.png" style="width: 100px">
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
SHARE
</div>
</div>
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
About
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<img src="https://www.google.ca/images/srpr/logo11w.png" style="width: 100px">
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
SHARE
</div>
</div>
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
About
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<img src="https://www.google.ca/images/srpr/logo11w.png" style="width: 100px">
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
SHARE
</div>
</div>
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
About
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<img src="https://www.google.ca/images/srpr/logo11w.png" style="width: 100px">
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
SHARE
</div>
</div>
</div>

Footer doesn't look like I want. Bootstrap

I have problems with footer in on website. It's a bit strange because I have never had problems with footers.
I want to place the footer exactly like the menu, I'm using Bootstrap so I'm using columns but it's not working. I don't know why the space between elements on footer is different (all elements has the same number of columns) and also it doesn't start where the menu starts.
This is the code:
HTML:
<div class="container"> <!--el container creo que hacía que los círculos se viesen más peques-->
<nav class="navbar navbar-default navbar-fixed-top menupropio">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img class="logo_menu img-responsive" src="images/logo_peque.png" alt="logo home"/>
</div>
<div id="navbar" class="navbar-collapse collapse">
<div class="secciones">
<ul class="nav navbar-nav" style="border-bottom:0px">
<!--<li class="active">Home</li>-->
<li>Kontakt</li>
<li>Valik üle 20 aasta jooksul tehtud töödest</li> <!--todo los trabajos juntos -->
<li>Logod</li> <!--en esta pagina van todos los logos-->
<li>Trükised ja muu</li> <!--todo lo que no sean logos-->
</ul>
</div>
</div><!--/.nav-collapse -->
</nav>
<!--work designs starts-->
<section class="row center-block text-center">
<div class="col-xs-6 col-sm-6 col-md-3">
<div class="rings">
<a href="res_publica.html"><img class="img-responsive img-circle" src="images/res_publica_valimiskampaania_kujundus_thumbnail.jpg" alt="Res Publica valimiskampaania"/>
<span>Res Publica valimiskampaania</span>
</a>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<div class="rings">
<a href="ajakiri_lofo.html"><img src="images/lofo_loodusfotoajakiri.jpg" class="img-responsive img-circle" alt="Ajakiri LoFo"/>
<span>Ajakiri LoFo</span>
</a>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<div class="rings">
<a href="kataloogid.html"><img src="images/kataloogid.jpg" class="img-responsive img-circle" alt="Kataloogid"/>
<span>Kataloogid</span>
</a>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<div class="rings">
<a href="hansab_logo.html"><img src="images/hansab_logo.jpg" class="img-responsive img-circle" alt="Hansab logo"/>
<span>Hansab logo</span>
</a>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<div class="rings">
<a href="hotelli_sildid.html"><img src="images/hotelli_do_not disturb_silt.jpg" class="img-responsive img-circle" alt="Hotelli sildid"/>
<span>Hotelli sildid</span>
</a>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<div class="rings">
<a href="mappkaaned.html"><img src="images/mappkaaned.jpg" class="img-responsive img-circle" alt="Mappkaaned"/>
<span>Mappkaaned</span>
</a>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<div class="rings">
<a href="seinakalender.html"><img src="images/seinakalender.jpg" class="img-responsive img-circle" alt="Seinakalender"/>
<span>Seinakalender</span>
</a>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<div class="rings">
<a href="ajakiri_psyk.fi.html"><img src="images/ajakiri_psyk_fi.jpg" class="img-responsive img-circle" alt="Ajakiri Psyk.fi"/>
<span>Ajakiri Psyk.fi</span>
</a>
</div>
</div>
</section>
</div> <!--container-->
<footer>
<div class="footer">
<div>
<div class="col-md-offset-4 col-sm-5 col-md-1 col-lg-1">
<p>Kiige RB OÜ</p>
</div>
<div class="col-sm-5 col-md-1 col-lg-1">
<a target="_blank" href="mailto:kiige#kiige.ee"><p>kiige#kiige.ee</p></a>
</div>
<div class="col-sm-5 col-md-1 col-lg-1">
<p>+(372) 50 20 506</p>
</div>
<div class="col-sm-5 col-md-1 col-lg-1">
<p>Tuleme hea meelega teile külla!</p>
</div>
</div>
</div>
</footer>
and CSS:
footer{
margin-top:0px;
color: black;
text-align: center;
font-size: 0.9em;
}
If you want to take a look at the website, this is the provisional link: http://clients.sabrinacouto.com/kiige/
Does anyone knows how to solve it?
Thanks a lot!
All your sections seem to use "row"
<section class="row center-block text-centre">
However, your footer doesn't have a row surrounding your columns to negate the spacing it adds. Col always adds an additional spacing to both sides. The row is there to negate that spacing if you have multiple cols.
Edit in your html as like this may it helps you
<footer>
<div class="footer">
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-3 col-lg-3">
<p>Kiige RB OÜ</p>
</div>
<div class="col-sm-6 col-md-3 col-lg-3">
<a target="_blank" href="mailto:kiige#kiige.ee"><p>kiige#kiige.ee</p></a>
</div>
<div class="col-sm-6 col-md-3 col-lg-3">
<p>+(372) 50 20 506</p>
</div>
<div class="col-sm-6 col-md-3 col-lg-3">
<p>Tuleme hea meelega teile külla!</p>
</div>
</div>
</div>
</div>
</footer>