jquery, jcarousel full width with window area - javascript

I've got a jcarousel object on my page that is set to 960px wide and centered, I've got overflow visible on the .jcarousel-clip with it set to 100% width so it's full window width.
I essentially want the run off from the carousel to always be visible, just like the new bbc beta slider, so I've set "wrap: circular"
If i set the start slide to 2 (not really what I want to do), the slider visually looks how I want it to, if I then navigate left(prev), the slider no longer goes to the edge of the window, when I then click prev again it briefly flashes the slide and moves it across. same when you go next a few times, you eventually come to a gap at the right of the screen.
So I guess I need to know if...
a) on jcourousel init, can you have the last slide staged to the left and still have start slide as 1 and...
b) can you stage the slides to the left and right on animation finish rather than on animation start?
have a look at the js fiddle example to see what I mean... http://jsfiddle.net/stikoo/3T97L/7/
Thanks in advance :D

Related

Split 3D Carousel Image Rotation Issue

I found a carousel (https://codepen.io/paulnoble/pen/yVyQxv) that has some awesome transitions and thought it'd be nice to integrate into a project I'm working on: https://joshrodg.com/halloffame/
My code is here: https://codepen.io/joshrodgers/pen/MWBPXBx
The responsiveness of the design needed to be adjusted slightly because to me having the content split (left, right) doesn't quite work that well on smaller screens (like phones) - it'd make it almost impossible to read. So, my idea was just to remove the right-side content all together.
I have that working and it looks exactly as I expect, except one thing...
Basically, there is vertical paging on the right-side of the slideshow. When you click on the next circle it rotates forward to the next slide, when you click on the previous circle, it rotates backwards to the previous slide. On a desktop screen (larger than 900px) the paging area stays on top of the rotating images, which makes the slideshow rotation look really nice. On my iPhone, and I'm guessing on other small screens, the rotating images appear to rotate on top of the paging area and then it re-appears.
I'm sure this is a simple tweak, but is there a way to keep the paging area on top while rotating through the images on a desktop and smaller screen like an iPhone?
This is also an issue on the original carousel, so I'm not sure how to fix it.
The paging area does have a z-index: 1 but for some reason the images still rotate on top of the paging area. I even tried setting it higher: z-index: 1000, but that didn't seem to do anything.
Anyone have any ideas?
Thanks
Josh
After looking into this a little more, I was able to find a solution!
My carousel__control div is what was controlling the vertical pagination, this was in carousel container and rightfully so, as it was controlling the position of everything inside. However, this also caused the issues I described, not really sure why.
All I did to fix this was move carousel__control out of the carousel container - basically right above it in the document. Then had to set my margins to match and adjust it's position. I couldn't keep the margin: auto and top: 0. Once I adjusted those two properties, everything started working as expected.
I have updated the pen here: https://codepen.io/joshrodgers/pen/MWBPXBx
Thanks,
Josh

How to re-slick with expandable slides

I have created a slick slider that contains expandable slides. A slide contains and image and a div with some text in it.
The div has a width of 0, and when clicking on the image the div expands. The slider fits 9 slides before arrows/dots are needed, i.e. slidesToShow is set to 9.
If I do not However, when the slide expands, the slides at the end are no longer visible and arrows are required.
I tried playing with a few different settings but nothing seems to work. I thought setPosition might do it, but no luck.
What is the best way to detect when the slides are no longer fully visible within the slider, and how would I get the arrows to appear in this situation and disappear when the slides are collapsed (i.e. they are all visible within the slider)?

Fullpage.js by Scrolling down scroll horizontally and on one Section go down after finishing scrol horizontal again?

With Fullpage.js i would like to only use Scrolling down to navigate to next page which is horizontally. On one Page I would like to go down a few slides, navigate vertically. After these are finished I would like to go to next slide which is horizontally again.
I got it working when my Slide which is going to scroll vertically is the last slide. But cannot get it to work when it's in the middle of the slides.
I made a picture to show what i mean:
Your approach is not the right one.
The image should look like this instead:
That is, 3 vertical sections.
The fist and last sections with with 2 horizontal slides each.
This way you will only need to make use of the fullPage.js extension called Scroll Horizontally and you'll have exactly what you want.
Scroll down from 1 will lead to 2.
Scroll down from 2 will lead to 3.
Scroll down from 3 will lead to 4.
Scroll down from 4 will lead to 5.

Sliding a background image on scroll

The latest vogue seems to be things that move when you scroll.
Now, I have a bunch of square divs containing a background image scattered around a long page of content. My idea is to ever so slightly make these background images slide upwards when you scroll downwards. The background image is as wide as the square, but 1.5 times as tall.
The easy solution is to set the backgroundPosition to a fraction of the current scrollTop, but when I thought about it more, it's not altogether that simple.
Essentially, the background image of a div should be at background-position: 0 0; when the div is just obscured beyond the fold. Once it appears, the top position would decrease relative to scrolling, until reaching the end of the background image's bottom edge once the div has disappeared over the top edge of the window.
The divs are floated within text content, so there's no way to hardcode any position values for them.
Maybe I could manage to do this on my own, but there are several considerations;
Scrolling back and forth at any speed, and never moving the background image to a location where any part of the square div wasn't covered.
Divs which appear in the middle of the page on load. It doesn't matter if the background-position isn't 0 0 for them initially, the important thing is that the background image moves at the same speed as all the others.
Adjusting when the user changes the window size.
Now since this is just an extra little flair, I'm not expecting amazing browser compatibility or that this would work on mobile (although if it does, cool).
But I can't even begin to think how all of this would work out. What would be the best way to achieve this? Since the scrolling sliding thing is so popular, are there any (jQuery) plug-ins that I could utilize to build this?

Sliding menu with CSS hardware acceleration using translate3d

I want a menu hidden at the top of the page, that slides down after clicking a button so it shifts the other content bellow it down. What I have is the hidden menu and I use jQuery functions slideDown() and slideUp() to toggle it. The problem is that eg. on iPhone the slide is not fluent, so I would like to use some acceleration.
I wanted to just add -webkit-trasnform: translate3d as described here, but this seems not working with jQuery slide functions. Also I tried to use jQuery('.menu').animate({height: ..}) but it didn't work also (I think jQuery toggle uses the same). So I found out, that probably the transform3d works only for moving elements by adjusting its coordingates (left, top ..) but not width and height.
I found out this jQuery plugin https://github.com/benbarnett/jQuery-Animate-Enhanced , that should help accelerate width and height changes also, but it didn't work at all in my case.
So I managed to move the menu by adjusting the Top property and adding translate3d, which finally makes the menu move fluently, but now I cannot force the content bellow it to move down when the menu slides - if the menu has position:relative and is moved out of the screen, there is still a hole of its height at the top of the content. If it has position:absolute , it doesn't influence content bellow. If position:static, Top: property has no influence.
Am I missing something or what is the "recommended" way to implement this ? You can see the current implementation on http://www.huureenkerstboom.nl (please downsize your browser window to see the mobile implementation).

Categories