Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • 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 269 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 Offline
    H Offline
    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 Offline
      RichardR Offline
      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 Offline
        H Offline
        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 Offline
          RichardR Offline
          Richard
          Global Moderator
          wrote on last edited by
          #4

          Dear @Hans-Pelle

          Cool :)
          Best of luck!

          Richard

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          I also code custom websites or custom Lay features.
          šŸ’æ Email me here: šŸ’æ
          info@laytheme.com

          Before you post:
          1. When using a WordPress Cache plugin, disable it or clear your cache.
          2. Update Lay Theme and all Lay Theme Addons
          3. Disable all Plugins
          4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

          This often solves issues you might run into

          When you post:
          1. Post a link to where the problem is
          2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
          3. If the problem is difficult to explain, post screenshots / link to a video to explain it
          Online Users
          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