Tag: Animation

  • Rellax e-Com

    Rellax e-Com

  • Animation and parallax – custom code in WordPress

    Animation and parallax – custom code in WordPress


    Animations, Effects and Custom Code in WordPress

    Parallax Javascript Library

    Rellax.js

    Rellax.js

    Here you can download Rellax.js:

    Rellax need this script at the end of your page or post:

    <!-- initiate Rellax Js -->
    <script>
      // Place this script at the end of the page.
      // Start Rellax
      var rellax = new Rellax('.rellax');
      // Destroy and create again parallax with previous settings
      // rellax.refresh();
    </script>

    How can I give a <div> or similar container elements full width?

    Here you have to have a closer look at the WP code. In your browser try to inspect a div, and note it’s width. If you do this you can see, that the div has a class named alignfull. Add this class to the WP markup:

    <!-- Put the cover inside a div element -->
    <div class="rellax alignfull" data-rellax-speed="3" style="width:100vw;">

    Don’t tell it.

    Show it!

    Url: https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExbDV2NjRjMHd4MmphbXV4NmFpOWhkMnJib3hvbWp6OWpuNGEwbmV4eSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9cw/3lxnK7ITpLB205JD5k/giphy.gif

    CSS animations

    How to add custom code
    e.g. from jsFiddle or CodePen

    Custom Code: CSS, HTML and JavaScript

    And yes – in this particular order:

    1. Add a custom HTML block.
    2. Copy the CSS and place it in a <style> element.
    3. Next insert the HTML
    4. After the HTML-element(s) add theJavaScript.

    In the Custom HTML block the code above could look like this:

    <style>
    #square {
      background-color: yellow;
      width: 125px;
      height: 125px;
      border: 3px solid black;
    }
    @keyframes example {
      from {left: 0px;}
      to {left: 200px}
    }
    .animate {
      position: relative;
      animation-name: example;
      animation-duration: 4s;
    }
    </style>
    <!-- Her følger HTML -->
    <div id="square"></div>
    <h3>Click the yellow square</h3>
    <script>
    let runAnimation = function(){
      square.classList.add("animate");
      setTimeout(clearClass, 4000);
    }
    // element.addEventListener("click", myAddClassFunction);
    square.addEventListener("click", runAnimation);
    //
    let clearClass = function(){
      square.classList.remove("animate");
    }
    </script>

    Click the yellow square!

    Custom Code in WP

    Animations
    Parallax
    CSS
    JavaScript

    Maps

    … and much more …
    Q.E.D.


  • Animation

    Animation

    This animation is made by the Animate Gutenberg Blocks Plugin.

  • Rellax – in practise

    Rellax – in practise

    Here is a parallax effect made via the Rellax library. Here is the recipe:

    • Add the divs that you want to animate.
    • At the bottom of the page add the Rellax Library

    Also see this page. There you’ll see the actual code.

    Images

    Convert the image to HTML and add the relevant data.



  • Parallax Effects by Rellax Js

    Parallax Effects by Rellax Js

    Demonstration of the Rellax Js Library.


    Per’s Rellax Tutorial (ca. 7 minutes)


    Stray <p> tags

    If you have whitespace in the code WP will add <p> tags, and such tags may ruin you JavaScript – or at least throw errors in the console. This will happen as soon as you save the page or post. This is most annoying.

    That’s why there is no space between the tags in the code above.

    In your editor you can install a plugin that will remove whitespace in the code.

    You can animate any HTML element, be it <p>, <img>, <article>, <figure> etc.

Enable Notifications OK No thanks

We use cookies - more information

Multimusen.dk will set a few cookies from Doubleclick, Google and the Social Media plugins they ay set some cookies. Some of my pages use APIs - such as YouTube, LinkedIn, Google Fonts, Google Maps, Mapbox, Spotify, Jetpack, Twitter, Facebook &c.. Such plugins may set the odd cookie.

Close