Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Scale Site Title on scroll

Scale Site Title on scroll

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 716 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H
    H
    Hans Pelle
    wrote on last edited by
    #1

    Hi

    I it possible to scale the Site Tile on scroll?

    This is the best example i have:
    https://kurppahosk.com/work/dustin/

    I would like to do sort of the same animation on the Site Title (VOLGA) on this site:
    https://www.volga.nu/info

    Best,
    Hans

    1 Reply Last reply
    0
    • RichardR
      RichardR
      Richard
      Global Moderator
      wrote on last edited by
      #2

      Dear Hans @Hans-Pelle

      This is possible but you would have to add a little Custom CSS & jQuery in "Lay Options - Custom CSS & HTML"

      The Text has its basic CSS properties but at a certain scroll point it gets a class added - in this case its a class called "stuck"

      That Class has its own CSS: So when it gets becomes the class 'Stuck" it also gets new CSS along with it

      Before the change its:

      .sticky-title {
          vertical-align: text-top;
          transition: all 0.4s !important;
      }
      

      Then when the user scroll's CSS is added that overrides the original:

      .stuck {
          position: fixed;
          left: calc(20% + .4rem);
          font-size: 1rem;
          z-index: 1;
      }
      

      So this is saying - fix the element to the top, calculate the elements position to left-hand of browser, change font-size etc

      The ; transition: all 0.4s !important;

      Is indeed important - it is what makes the smooth "transition" between the too states - without it, it would just flick from big to small instantly:
      https://www.w3schools.com/css/css3_transitions.asp

      Look into something like this:
      https://stackoverflow.com/questions/12558311/add-remove-class-with-jquery-based-on-vertical-scroll

      & remember when adding JS/jquery you need to wrap your code in a newpage event and change '$' to 'jQuery'
      https://laytheme.com/documentation.html#custom-javascript

      E.g

      window.laytheme.on("newpageshown", function(layoutObj, type, obj){
      
      // INSERT YOUR CODE HERE_____
      
      });
      

      Good Luck Hans -Google is out best friend!
      Let me know how you go & thank you for using Lay Theme in 2021

      Richard

      1 Reply Last reply
      0
      • H
        H
        Hans Pelle
        wrote on last edited by
        #3

        Hi @Richard-K

        Thank you for your answer. I'll try it out, thanks.

        Best,
        Hans

        1 Reply Last reply
        0
        • RichardR
          RichardR
          Richard
          Global Moderator
          wrote on last edited by
          #4

          Dear @Hans-Pelle

          Cool :)
          Best of luck!

          Richard

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          Online Users
          J
          j.varela
          Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
          laytheme.com
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Search