Lien externe fond d'écran

Fermé
Utilisateur anonyme - 2 juil. 2015 à 00:07
 Utilisateur anonyme - 27 sept. 2015 à 16:50
Bonjour,

sur mon site otakuplayer.fr je souhaite que en cliquand sur mon fond'écran on a acces a un lien d'article. avez vous une idée ? merci a vous


A voir également:

1 réponse

animostab Messages postés 2829 Date d'inscription jeudi 10 mars 2005 Statut Membre Dernière intervention 11 novembre 2019 738
3 juil. 2015 à 13:33
Bonjour

1) tu fais un div dans lequel tu mets ton lien

<div id="lienarticle"><p><a href="article.php">cliquez pour voir l'article</a></p></div>


2) avec css tu le mets en fixed et par dessus avec z-index et tu le cache

#lienarticle {
position: fixed;
width:50%;
height:30px;
left: 25%;
top:50%;
margin-top:-15px;
display:none;
border:1px solid black;
background:white;
z-index:10000;
text-align:center;
}


3) avec jquery tu affiche / désaffiche au click sur body

<script>
$(document).ready(function(){
$("body").toggle(function(){$("#lienarticle").show();},function(){$("#lienarticle").hide();});
})
 </script>
0
animostab Messages postés 2829 Date d'inscription jeudi 10 mars 2005 Statut Membre Dernière intervention 11 novembre 2019 738
3 juil. 2015 à 15:05
petite erreur dans ce script fais plutot

html
<div id="page1">
<div id="lienarticle">
<p><a href="article.php">cliquez pour voir l'article</a></p>
<button id="close">fermer le lien</button></div></div>
<div id="page">
</div>


css
#page1 { 
margin:0;
width:100%;
height:100%;
position fixed;
background:black;
z-index:100;
display:none;
}
#lienarticle {
position: fixed;
width:50%;
height:70px;
left: 25%;
top:50%;
margin-top:-35px;
border:1px solid black;
background:white;
z-index:10000;
text-align:center;
}
#page {
height:100%;
width:50%;
margin:auto;
background:yellow;
z-index:10;
}


javascript
<script>
$(document).ready(function(){
if($("#page1").is(":hidden")){
$("body").click(function(){$("#page1").show();})
}
$("#close").click(function(){$("#page1, #lienarticle").slideUp(300);})
})
</script>
0
Utilisateur anonyme
27 sept. 2015 à 16:50
bonjour je n'ai pas compris ou mettre cela .. otakuplayer.fr
0