Lien externe fond d'écran

Utilisateur anonyme -  
 Utilisateur anonyme -
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

1 réponse

  1. animostab Messages postés 3003 Date d'inscription   Statut Membre Dernière intervention   738
     
    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
    1. animostab Messages postés 3003 Date d'inscription   Statut Membre Dernière intervention   738
       
      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
    2. Utilisateur anonyme
       
      bonjour je n'ai pas compris ou mettre cela .. otakuplayer.fr
      0