comment inclure mon animation JQuery (Créer un compte)

  • Statut : non résolu
2 sujets de 1 à 2 (sur un total de 2)
  • Auteur
    Messages
  • #537225
    tuego
    Membre
    Initié WordPress
    1 contributions

    Bonjour,

    Ma configuration WP actuelle
    – Version de WordPress :3.9 :
    – Thème utilisé : Frontier :

    Problème(s) rencontré(s): :
    J’aimerais beaucoup savoir comment intégrer une page web que j’ai créée avec du html, css et javascript. En tant que page html, elle fonctionne très bien. L’animation se fait.

    Mais quand j’essai de recopier cette page en créant une page wordpress, je n’arrive pas à faire fonctionner le javascript. J’ai installé un plugin où je peux ajouter du css et du javascript à part. Le css fonctionne très bien mais le javascript ne fonctionne pas.
    Voici le code

    HTML:

    <!--START THE WRAPPER-->
    <div class='curtain_wrapper'>

    <!-- 2 CURTAIN IMAGES START HERE -->
    <img class='curtain leftcurtain' src='images/frontcurtain.jpg' />
    <img class='curtain rightcurtain' src='images/frontcurtain.jpg' />
    <!-- END IMAGES -->

    <!-- START THE CONTENT DIV -->
    <div class='content'>
    <!-- YOUR CONTENT HERE -->
    <h3>Curtain effect </h3>
    <p style="color: #F00; font-size: 36px; font-style: oblique;">
    Bienvenue sur le site de Prends-en une autre ça va passer…
    </p>
    <!-- END YOUR CONTENT -->
    </div>
    <!-- END THE CONTENT DIV -->

    <!-- START DESCRIPTION DIV, WHICH WILL BE SHOWN ON TOP OF THE CURTAIN AND REMOVED WHEN THE CURTAINS OPEN -->
    <div class='description'>
    <img class="rope" src='images/rope.png'/>
    </div>
    <!-- END DESCRIPTION DIV -->


    </div>
    <!--END THE WRAPPER-->

    le javascript:

    $(document).ready(function(){

    // when user clicks inside the container…
    $(‘.curtain_wrapper’).click(function(){

    //..animate the description div by changing it’s left position to it’s width (but as negative number)…
    $(this).children(‘.description’).animate({‘left’: -1*$(this).width()});

    //…animate the 2 curtain images to width of 50px with duration of 2 seconds…
    $(this).children(‘img.curtain’).animate({ width: 50 },{duration: 2000});

    //…show the content behind the curtains with fadeIn function (2 seconds)
    $(this).children(‘.content’).fadeIn(2000);

    });

    });

    css:

    {
    margin:0;
    padding:0;
    }
    body {
    text-align: center;
    background: url(../images/darkcurtain.jpg) repeat-x;
    }
    img{
    border: none;
    }
    .leftcurtain{
    width: 50%;
    height: 495px;
    top: 0px;
    left: 0px;
    position: absolute;
    z-index: 2;
    }
    .rightcurtain{
    width: 51%;
    height: 495px;
    right: 0px;
    top: 0px;
    position: absolute;
    z-index: 3;
    }
    .rightcurtain img, .leftcurtain img{
    width: 100%;
    height: 100%;
    }
    /*THE TEXT DIV CLASS (BEHIND THE CURTAINS)*/
    .content{
    position:relative; /*so we can center it*/
    width: 300px; /*curtain_wrapper width – shrinked image width (50px is image when shrinked)*/
    margin:0px auto; /*center it*/
    display:none; /*we don’t want our users to see the content while the curtain images are loading*/
    }
    .logo{
    margin: 0px auto;
    margin-top: 150px;
    }
    .rope{
    position: absolute;
    top: -40px;
    left: 70%;
    z-index: 100;
    }

    merci pour votre aide

    #950814
    GforCrea
    Participant
    Initié WordPress
    47 contributions

    Bonjour

    Tu as essayé d’intégrer ta page en créant un modèle de page pour WordPress ?

2 sujets de 1 à 2 (sur un total de 2)
  • Vous devez être connecté pour répondre à ce sujet.