Forums

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

Home Forums CSS Chris’ Latest Article. (start and stop slider)

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #23707
    mshort
    Member

    hey all, I am just trying to do chris’ tutorial , I’ve written all the javascript, although I’m quite a dummy when it comes to javascript so i’ve messed somthing up and its not working, so I was wondering if someone could take a look at my javascript code and let me know if and what i’ve done wrong.

    thanks in advance
    Michael.

    Code:
    var delayLength: 40000;
    var panelWidth = 960;
    var numPanels = 3;
    var tooFar = -(panelWidth * numPanels);

    $(function(){

    $(“#slider”).append(‘Stop‘);
    function doMove() {

    var leftValue = $(“#mover”).css(“left”);
    var movement = parseFloat(leftValue, 10) – panelWidth;

    if (movement == toofar) {

    $(“.slide img”).animate({
    “top”: -200
    }, function() {
    $(“#mover”).animate){
    “left”: 0
    }, function() {
    $(“.slide img”).animate({
    “top”: 20
    });
    });
    })

    }
    else {
    $(“.slide img”).animate({
    “top”: -200
    }, function() {
    $(“#mover”).animate({
    “left”: movement
    }, function(){
    $(“.slide img”).animate({
    “top”: 20
    });
    });
    });
    };

    }

    });

Viewing 1 post (of 1 total)
  • The forum ‘CSS’ is closed to new topics and replies.