maj css home + new js

This commit is contained in:
Jerome Morjon 2015-03-09 15:13:02 +01:00
parent 6ffe9e1f78
commit 544a9d5473
3 changed files with 26 additions and 10 deletions

View File

@ -47,8 +47,8 @@ body {
{
border: 7px solid white;
box-shadow: 0px 0px 3px black;
width: 250px;
height: 250px;
width: 250px !important;
height: 250px !important;
max-height : 250px;
max-width : 250px;
background: #ffffff; /* Old browsers */

View File

@ -0,0 +1,19 @@
// fonction qui recherche le referent donnee en parametre
function rechercherReferent()
{
// on recupere le mot cle rentrer dans le champs de recherche
var motCle = document.getElementById("searchfield").value;
//boucle sur chaque item
var list = document.getElementsByClassName("item");
for (var i = 0; i < list.length; i++)
{
referent = list[i].getElementsByClassName('nomRef')[0].innerHTML; //recupere le nom du referent referent
if (referent.indexOf(motCle) > -1) //on compare si la recherche correspond au nom
{
//on remplace la classe
list[i].className = "item active";
}
}
}

View File

@ -6,10 +6,10 @@
<center>
<img style="height:auto; width:auto; max-width:100px;" alt="" src="./pictures/homePic/home.png">
<nav>
<form class="form-inline navbar">
<form class="form-inline navbar" onsubmit="rechercherReferent()">
<div class="row divRecherche">
<div class="col-xs-12">
<input class="form-control inpSear" placeholder="Rechercher un Référant" name="search" onchange="hideIcon(this);" type="text">
<input id="searchfield" class="form-control inpSear" placeholder="Rechercher un Référant" name="search" type="text"/>
</div>
</div>
</form>
@ -32,7 +32,7 @@
<!-- Parametres des images -->
<div class="carousel-inner" role="listbox">
<div id="caroussel" class="carousel-inner" role="listbox">
@foreach ($referent as $ref)
@if ($ref -> id == $referent[0] -> id)
<div class="item active">
@ -58,18 +58,15 @@
</div>
</div>
@else
blabla LOL
@endif
<script type="text/javascript">
document.oncontextmenu = new Function("return false");
document.oncontextmenu = new Function("return true");
function hideIcon(self) {
self.style.backgroundImage = 'none';
}
</script>
<script type="text/javascript" src="/js/rechercheRef.js"> </script>
</center>
@endsection