Giter Club home page Giter Club logo

sticky's Introduction

Welcome to Remix!

Fly Setup

  1. Install flyctl

  2. Sign up and log in to Fly

flyctl auth signup
  1. Setup Fly. It might ask if you want to deploy, say no since you haven't built the app yet.
flyctl launch

Development

From your terminal:

npm run dev

This starts your app in development mode, rebuilding assets on file changes.

Deployment

If you've followed the setup instructions already, all you need to do is run this:

npm run deploy

You can run flyctl info to get the url and ip address of your server.

Check out the fly docs for more information.

sticky's People

Contributors

acconrad avatar acwong00 avatar benedekh avatar bhamodi avatar chh avatar chrisvdp avatar crisfole avatar daronco avatar davidmcooper avatar duzun avatar garand avatar geoffharcourt avatar gion avatar gkoychev avatar graingert avatar hugoheneault avatar jimmynyny avatar juanbrujo avatar juanvillegas avatar kevinsawicki avatar kkirsche avatar kronuz avatar maxsh avatar pvgrad avatar ruudk avatar simenb avatar stefanhayden avatar stuartquin avatar thochra avatar yatskevich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sticky's Issues

Will only work as intended on elements with an ID

Will only work as intended on elements with an ID, so:

$("h1, h2").sticky('destroy');

will result in all matching elements receiving a wrapper #undefined-sticky-wrapper which will not be unique.

not sure of the best way around this. maybe throw a warning? or just say in the docs that you must use ID'd elements?

Google ads loading twice when i put it inside the sticky div

i tried to a google ads inside the div which containing id="sticker" i works well BUT the ads reloading again after the page have been loaded

example : http://photoshop-online-courses.com/inspiration/the-art-of-photo-manipulation-with-photoshop.html
look at the sidebar on the left which have 2 google ads, at the page loading the ads is loaded normally but after that page is fully loaded the 2 google ads in the sidebar will be reloaded again

i think the problem is in this code :

<script> $(window).load(function(){ $("#sticker").sticky({ topSpacing: 50, className: 'sticky', wrapperClassName: 'my-wrapper' }); }); </script>

Really i hope to fix this problem soon
Thanks

jquery version problem in google chrome

Hi,

I try to use stickyjs with a jquery version 1.7.2 but, script doesn't work on chrome browser. 1.8.2 works fine but i have to use 1.7.2.

Is it a stickyjs version problem?

Issue with IE7 & IE8 and dynamic content

First, thank you for the great plugin!

We are using the plugin with IE7+. We've noticed an odd behavior only in IE7 & IE8. The issue appears to be when you dynamically add/show/hide content to the page which triggers the need for the scroll bar. In this case, in IE7 & IE8 only, the 'resize' event gets fired, not the 'scroll' event. As a result, the sticky element never gets re-rendered to reflect the new content size since all the logic to reposition the element is in the 'scroll' event handler.

I was able to solve the problem with a slight hack, that being updating the code as follows:

resizer = function () {
        windowHeight = $window.height();
        scroller();
    },

Essentially trigger the reposition logic on both resize and scroll events to capture all situations.

I'm curious your thoughts on this solution. Thanks!

Not grabbing text elements?

when I apply the sticky function to a div with this structure:

<div id="stick">
    <p>Text</p>
        <a href="somelink.com" target="_blank">
            <img src="someimage.jpg">
        </a><br />
        <a href="somelink.com" target="_blank">
            <img src="someimage.jpg">
        </a><br />
        <a href="somelink.com" target="_blank">
            <img src="someimage.jpg">
        </a>
</div>

only the images are responding to the function. the <p /> element does not stick. I've also tried it with a <h2 /> and it won't stick either.

in fact just:

<div id="stick">
    <p>Text</p>
</div>

will not stick either. am I don't something wrong, or is this a bug?

Doesn't work in iPad

Nice project, but it doesn't work in iPad Safari mobile, my version of OS is 4.2.

Overlay Problem

Hi there.
I used sticky.js on my menu-bar and it works fine, but other javascript content on my site (eg. google map) is displayed on top of the menu when i scroll down.
Thanks again,
Jochen

Role of line 77? css('height'…

Adding css('height' of sticky element to the DOM is breaking my layout.

I’ve commented out line 77 and not seeing any negative effects.

Wondering if you can explain whether style="height:…" is critical to the plugin in certain browsers?

Add support for Bower

Bower is a popular front-end package manager. It would be nice if the package could be installed using Bower.

Option to limit sticky element to parent container

Would be great if you could add the option to limit the sticky element to its parent container, or even specify a height from the top/bottom of the page at which a sticky element loses the fixed positioning and assumes a new relative position.

Cheers!

Sticky stops sticking in Chrome

The Sticky plugin stops sticking in Google Chrome if -webkit-transform: translateZ(0); is included in the CSS. In my case the CSS was
html{
-webkit-transform: translateZ(0);
}

Not sure if this broke Safari as well though as didn't test it.

If scrolling when sticky element is hidden means element can become fixed at the wrong time

Hi,

I had a problem on my website where if I scrolled down before revealing/un-hiding (it is defaulted to "display: none" and I have a jquery slideToggle) the element containing my sticky div, the sticky div might incorrectly appear at the top of the window once I did reveal it.

I fixed the issue. It was only a small change... However, I am new to GitHub (and git, for that matter) and I'm not entirely sure how I can request to get this fix put back into the repo...

Sticky Element with Dynamic Height

Hi, great plugin but there's always one issue that has been bothering me..
If the sticky element's height changes on responsive layout then the inline height that's specified on the sticky element will become incorrect.

So it's good if there is some method added that can be used to recalculate the element's height like on window resize.

Thanks :)

Fixed Width Applying on Default

Once an item is stickied, the script is applying a fixed width, even with no 'getwidthFrom' specified. This was causing me a bit of a headache at first because I am using it for a navigation item that has a 100% width. I was able to fixed this by changing the default value of the variable from '' to 'undefined' (line 20).

z-index

Allow us to change the default z-index of the main Wrapper. I need to change it becouse it is appearing bellow some divs.

resize sticky bar on window resize

Hi I can't find a way of resizing the stick bar i have on window resize. The thing i need to resize is the getWidthFrom. the getWidthFrom needs to update. Any way to do this?

could possible solution using the sticky('update') method?

Sticky element is flickering when scrollup - when sticking

For example in the demo site "http://stickyjs.com/", scroll using mouse wheel, when element is about to stick to top, it is disappearing for a moment and then displayed - this is causing a flicker effect, is there any solution for this sticking to happen in a smooth transition. But when, window is scrolled using mouse pointer, the transition is very smooth(this effect is required when scrolled using mouse wheel).

Google Chrome CSS3 linear gradients re-rendering in stickyElement using wrapAll()

Hi,

I've come across an issue local to Google Chrome when I have elements in the stickElement object that use CSS3 linear-Gradients (it may go beyond CSS3 linear-gradient but I haven't looked in other scenarios), they seem to re-render themselves with a noticeable jump when the wrapAll() method is called, this also forces the stickyWrapper to inherit an incorrect height.

I have looked at the plugin and have re-written a few areas to drop use of wrapAll() and instead use a clone() of the stickElement, create a new jQuery DOM object for the stickyWrapper, apply css attributes based on the original stickyElement that is still in position in the HTML DOM, append the clone stickyElement to the new stickyWrapper and replace the original stickyElement in the DOM with the new object using replaceWith()

My new code:

/* Sticky Plugin
** =============
** Author: Anthony Garand
** Improvements by: Phil Middlemass (www.leighton.com)
** Changelog:   Remove use of wrapAll() to work around rerendering issues with
                CSS3 linear-gradients of elements with the stickyElement in
                Google Chrome. Now uses combination of a cloned stickyElement
                and a new jQuery DOM element and replaceWith() to replace the
                stickyElement with our new code.

** Date: 8/17/2011
** Website: http://labs.anthonygarand.com/sticky
** Description: Makes an element on the page stick on the screen
*/

(function($){
    $.fn.sticky = function(options) {
        var defaults = {
            topSpacing: 0,
            className: 'is-sticky'
        };  
        var o = $.extend(defaults, options);
        return this.each(function() {
            var topSpacing = o.topSpacing,
            $el = $(this); /* New reference to original Sticky Element */
            stickyElement = $el.clone(),  /* StickyElement now becomes a clone of $el (to maintain CSS3 rendering) */
            stickyId = stickyElement.attr('id'),
            fixed = false;
            stickyElement
                .css('width', $el.width());     /* Use the DOM properties of $el to set data on stickyElement */
            var stickyWrapper = $('<div id="' + stickyId + 'StickyWrapper"></div>');    /* Create New DOM element for the wrapper - Removed use of wrapAll (CSS3 compatibility) */
            stickyWrapper
                .css('width', $el.outerWidth())     /* Use the DOM properties of $el to set data on stickyWrapper */
                .css('height', $el.outerHeight())
                .css('clear', $el.css('clear'))
                .append(stickyElement);     /* Append our new cloned element to stickyWrapper */
            $el.replaceWith(stickyWrapper); /* Replace $el in the DOM with our new stickyWrapper */
            $(window).scroll(function() {
                var scrollTop = $(window).scrollTop();
                var elementTop = stickyWrapper.offset().top;
                if (scrollTop <= elementTop - topSpacing) {
                    if (fixed) {
                        stickyElement.css('position', '').css('top', '').removeClass(o.className);
                        fixed = false;
                    }
                }
                else if (!fixed) {
                    if (scrollTop >= elementTop - topSpacing) {
                        stickyElement.css('position', 'fixed').css('top', topSpacing).addClass(o.className);
                        fixed = true;
                    }
                }
            });
        });
    };
})(jQuery); 

I'm now using this on some prototype pages for a client and all seems to good so far.

let me know if this is something you can absorb

Phil.

Firefox 26.0 Issue

In Firefox version 26.0 the 'example-right' is not functioning properly. When you use firefox the sticky container jumps to the right as you scroll down. It seems to work fine in Chrome and Safari. I am experiencing similar results in one of my projects.

Any suggestions on how to resolve this issue?

Sticky area violates allowable zone when too small

If my screen is too small, the sticky area will overlap areas it shouldn't. I will look into this and write a pull request if I have time but was hoping someone might have a quick fix instead!

Screen Shot 2012-12-11 at 11 45 31 PM

This isn't exactly a bug, more of an idea to improve the plugin, perhaps having some kind of allowable zone the sticky area can stay in?

Sticky not working in IE7 & IE8

Thanks for the Plugin! I really appreciate your work.

Of course IE does make problems: Line 72 (wrapper = $...) produces a failure: "Object doesn't support this property or method"

sticky footer bar

i would like to have a sticky footer bar as easy usable as your sticky top (bars) are :)

cannot set #sticker-sticky-wrapper to height: 100%

Hi,
I'm using the plugin in a "responsive" design, which the div wrapper should be height: 100%. In order that when browser window is resized(without reloading)height should always fit(it doesn't happen atm, as #sticker-sticky-wrapper generates a height in px ).

I tried this http://jsfiddle.net/UgPFQ/
but now, in the moment when the transition occurs, there's a "bump" going on. The transition is not smooth. I has a quirk as soon as #sticker gets hidden.

I was discussing the issue with a friend, and the guess was that:
"the plugin creates some empty space at the top of the page, which appears behind the sticky element, so the rest of the page still sits in place.

<script> $(window).load(function(){ $("#sticker").sticky({ topSpacing: 0, className: 'sticky', wrapperClassName: 'sticky-wrap' }); $(window).resize(function () { $('#sticker-sticky-wrapper').height('100%'); }).trigger('resize'); }); </script>

The above code changes the height of the sticky element to 100%, but the code is still using the old value for the height of the space it creates, which is why is jumots."
Any ideas in how to make this working?

Proposal (with code): Make bottomspacing dependendant on an element (responsive, fluid layouts)

Just modified an already modified version... Otherwise i have offered a pull request. What i needed was to make the bottomspacing be variable and not a fixed value. We have a responsive layout. so the bottomspacing needed to change... In the modified version we use there are two new variables "bottomSpacingEl" and "bottomSpacingElPadding". The element is the element which offset defines the bottomspacing, the bottomSpacingElPadding is used for a space. Very simple but useful addition maybe :) Just an image of the diff..

bildschirmfoto 2013-09-30 um 12 12 10

Saludos

Anchor tags from sticky nav are hidden under the sticky nav

When I use sticky nav for anchor jump links on the page, the page jumps to have the anchor at top:0px of the page, but this is hidden under the sticky nav. The plugin should account for the height of the sticky nav and adjust anchor links to show up right below the sticky nav.

See screenshot of what's happening now:
hiddenanchorundersticky

It should look like this:
whatitshouldlooklike

"className" is added to parent of sticky element

Hi! This plugin has saved me countless hours! 🍪 😄

But I want to give some sticky elements on my page some common styles, so I set the plugin's className option to something common to these two elements, e.g. sticky-top-bar and style it.

The sticky wrapper plugin however, does apply this class both to the wrapper (.sticky-wrapper) and to the sticky element. So when the element is sticked, then the styles are applied to both elements, which looks weird.

My suggestion would be to omit the className from the wrapper, but I don't now which technical decision was behind this.

when scrolling is done without finger swiping, sticky element doesn't stick to top

when scroll is done without finger swiping, sticky element doesn't stick to top.

i am currently using this to make the page scroll to a specific element:

$(function() {
    $('nav a').bind('click',function(event){
        var $anchor = $(this);

        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top -60
        }, 1000);

        event.preventDefault();

    });
});

would be ideal for the bar to stick to the top when the scroll is done.

thank you for this plugin btw, its super slim and useful.

Sticky based upon an optional scolling element

Hi,

I'm trying to make something sticky inside a scrolling div, it might just be my example but I couldn't get it to work.

Looking through the source code I'm guessing it's based upon the window itself scrolling - which is cool as I'm guessing most people will want that.

It would be handy to be able to override which element we treat as the scroller.

destroy method

I'd love to see a destroy method so I can programatically remove sticky-ness from the page.

As far as I know, this method is recommended for all jQuery plugins.

Duplicate div

hello:
This plugin seems wonderful, and its operation is very aesthetic.
But I encounter a problem.
When I apply it to a flash banner, it doubles or triples. So, 2 or 3 times the flash banner.

issue

Thanks!!

Adding margin below sticky bar?

I'm currently using the sticky plugin to hold a list of page anchors, which use jQuery's .animate() function for smooth scrolling. However, when any of the anchors are clicked, the sticky div ends up overlapping some of the content. Is there a way to prevent this overlap, since the position of the div isn't static?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.