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

R

raphael75011

@raphael75011
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Sticky position with jQuery
    R raphael75011

    Hi @Richard-Keith

    Thanks for your kind answer. I have some notion of html/css unfortunately I don't know how to write javascript. Here is the function, maybe you know more than me.
    Best,

    Raphaël.

    <script>

    jQuery(document).ready(function($) {

    function sticky()
    {
        var window_top=$(window).scrollTop();
        var top_position=$('body').offset().top;
        var element_to_stick=$('#header');
        
        if (window_top > top_position) {
            element_to_stick.addClass('sticky');
        } else {
            element_to_stick.removeClass('sticky');
        }
    }
    $(window).scroll(sticky);
    sticky();
    

    });
    </script>

    General Discussion

  • Sticky position with jQuery
    R raphael75011

    Re: Text Element Sticky: stick to top on scroll

    Hello,

    I am using a javascript fonction that I found on the forum to
    use a sticky position on a block of text. It is working but not totally. When you scroll up there is a bug, as you can see here: http://wcnhxpk.cluster028.hosting.ovh.net/projet-1
    Do you have a solution to fix it?
    Thank you so much,

    Raphaël.

    General Discussion
  • Login

  • Don't have an account? Register

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