2

I'm working on a horizontal scrolling website utilizing "Skrollr." I am attempting to line up pictures and make a scrolling loop. However there seems to be a very thin white line in between the pictures regardless of what I do. Is there anyway to make the sections/pictures overlap by a few pixels or any other solution to solve this? I created a JSFiddle to demonstrate the problem. I've also listed my basic set up below.

https://jsfiddle.net/9xvu128g/

Update: This happens regardless of the images used see this 2nd JSFiddle: https://jsfiddle.net/9xvu128g/5/

#slides-container{
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#slides{
width: 200%;
height: 200%;
position: fixed;
top: 0;
left: 0
}
AndrewLeonardi
  • 3,351
  • 9
  • 47
  • 100

3 Answers3

2

here is the working fiddle. I gave a negative 1px margin-left to slide 2 and it solved the issue

https://jsfiddle.net/vndgqndc/

#slide-2{
    background: url('http://i.imgur.com/LLxbI.jpg') no-repeat center center;
    background-size: cover;
    -ms-transform: translate(100%, 0%); /* IE 9 */
    -webkit-transform: translate(100%, 0%); /* Chrome, Safari, Opera */
    transform: translate(100%, 0%);
     z-index: -1000;
     margin-left: -1px;
}

OR alternatively, you can set the translate to 99.9% as stated by Scott

#slide-2{
    background: url('http://i.imgur.com/LLxbI.jpg') no-repeat center center;
    background-size: cover;
    -ms-transform: translate(99.9%, 0%); /* IE 9 */
    -webkit-transform: translate(99.9%, 0%); /* Chrome, Safari, Opera */
    transform: translate(99.9%, 0%);
     z-index: -1000;
     margin-left: 0px;
}
Rahul Arora
  • 4,503
  • 1
  • 16
  • 24
  • 1
    This nearly solves the problem. The issue is if you have more than 2 slides margin-left stops working. Also I was having to switch between 99.9% and 200.01% etc to make it work on more than two slides. Likely will mark this as correct if there are no more official answers. Thanks for the help! – AndrewLeonardi Jul 22 '16 at 12:25
1

Another posibility would be to scale slightly the slide

#slide-2{
    background: url('http://i.imgur.com/LLxbI.jpg') no-repeat center center;
    background-size: cover;
    transform: translate(100%, 0%) scale(1.001);
     z-index: -1000;
}

fiddle

vals
  • 61,425
  • 11
  • 89
  • 138
0

One option is to set the background color to black on the body.

Alternately, you can set a background color on each slide background. In this example, I set the background color to black on both images: https://jsfiddle.net/vdtaylor/9xvu128g/7/

I'm not 100% sure, but I believe you're running into an antialiasing on the edges of the image?

#slide-1 {
    background: url('http://i.imgur.com/LLxbI.jpg') no-repeat center center;
    background-size: cover;
    z-index: -1000;
    background-color: #000;
}
Vaughn D. Taylor
  • 617
  • 1
  • 8
  • 20