Treehouse: Grow your CSS skills. Land your dream job.

Slider Transitions Only Work if CSS is Applied In-Line

  • MBM
    # October 26, 2012 at 10:13 pm

    I’m using the code from this tutorial :

    For some reason the transition effects only work if the css is applied inline but I would prefer to keep the css in a stylesheet. Any ideas why the transitions aren’t working when the css is called externally? I don’t think there’s an issue with how I have linked to the stylesheet?

    < !doctype html>

    # October 27, 2012 at 12:32 pm

    link to site?

    # October 27, 2012 at 1:47 pm

    The transition effects only work in Firefox and IE10 if I link to an external stylesheet but if you look at the demo in the original link :

    They work in chrome and opera as well.

    # October 27, 2012 at 1:58 pm

    You forgot to add prefixes. (-webkit-transform, -moz-transform, -o-transform etc..) line 54 and 25.

    # October 27, 2012 at 2:24 pm

    That wasn’t mentioned in the tutorial! Thanks working now :

    position: absolute;
    left: 0; top: 0;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
    -o-transition : all 0.5s;

    .slider input[name=’slide_switch’] ~ img {
    opacity: 0;
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -o-transform : scale(1.1);

    .slider input[name=’slide_switch’]:checked+label+img {
    opacity: 1;
    transform: scale(1);
    -webkit-transform: scale(1);
    -moz-transform: scale(1);
    -o-transform : scale(1);

    # October 27, 2012 at 8:56 pm

    One final issue with the script is that on an actual mobile device (i.e. not resizing a browser window on a PC) the thumbnails do not change the main slider image and that goes for the original code from the codeplayer link. Any idea why?

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

You must be logged in to reply to this topic.