Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Slider Transitions Only Work if CSS is Applied In-Line

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #40477
    MBM
    Participant

    I’m using the code from this tutorial :

    http://thecodeplayer.com/walkthrough/css3-image-slider-with-stylized-thumbnails

    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?




    #112759
    matt_sanford
    Participant

    link to site?

    #112764
    MBM
    Participant

    http://mbmitservices.co.uk/slider.htm

    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 :

    http://thecodeplayer.com/walkthrough/css3-image-slider-with-stylized-thumbnails

    They work in chrome and opera as well.

    #112766
    matt_sanford
    Participant

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

    #112771
    MBM
    Participant

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

    .slider>img{
    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);
    }

    #112792
    MBM
    Participant

    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)
  • The forum ‘CSS’ is closed to new topics and replies.