Grow your CSS skills. Land your dream job.

HELP ME PLEASE!!!

  • # June 27, 2013 at 8:24 am

    Hey guys I am making a Carousel.. or at-least attempting to and ran into a few problems. I need to know:

    How do I make a click function run more then once.

    How do I make it so when you click on each item it switches with the current one without having to click them in a specific order.

    I am trying to achieve the effect of the main click I have running, to get a feel of what im looking for click the first item to the left on the carousel.

    here is the source. http://codepen.io/marshall_993/pen/jdEtJ

    # June 27, 2013 at 8:50 am

    hi @ScottMarshall, I’m too started to learn JS (jQ) maybe I will help ?

    > How do I make it so when you click on each item it switches with the current one without having to click them in a specific order.

    Do you mean if click on left box it become front and in click on right box it change on front, I right understood?

    # June 27, 2013 at 8:55 am

    If you’re okay with using transitions (which I added to `.Items`)

    http://codepen.io/CrocoDillon/pen/hpEFj

    # June 27, 2013 at 8:58 am

    you didn’t give me a chance))

    # June 27, 2013 at 9:04 am

    My version is buggy (something not transitioning well), here’s your chance to fix that (maybe leave transitions out and don’t swap classes but swap properties (with animate) instead ;)

    # June 27, 2013 at 11:47 am

    I will try but what mean this **i** parameter you don’t used it in a function, but it seems crucial?

    # June 27, 2013 at 11:57 am

    Awesome I like the way you went about it @CrocoDillon im just concerned about the little jagged transition from the left is there any way to use animate the same way you used transitions?

    # June 27, 2013 at 4:43 pm

    @CrocoDillon very nice demo. If you declare margin: 0 and padding: 0 on .carousel the jump from the left disappears. Then just change the left positioning on .Right and .Right2 to center things back up. The very left li still flickers occasionally, do you know what might cause that?

    http://codepen.io/waylaid/pen/hwnoL

    # June 27, 2013 at 5:08 pm

    Turns out it’s an easy fix, give `.Front` a `left` property. Updated my Pen.

    @Kuzyo, that’s the index of the class name in that array, don’t need it, just the class name itself (`cl` parameter).

    EDIT: Didn’t refresh to see your comment @waylaid, will have a look now.

    EDIT: Don’t know about the flickering…

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".