Skip to content

Instantly share code, notes, and snippets.

@guitsaru
Created March 27, 2009 00:51

Revisions

  1. guitsaru revised this gist Mar 27, 2009. 1 changed file with 33 additions and 29 deletions.
    62 changes: 33 additions & 29 deletions stop-timer.js
    Original file line number Diff line number Diff line change
    @@ -1,32 +1,36 @@
    $(document).ready(function() {
    $('#featured-location-0').show();
    });
    $(document).ready(function() {
    $('#featured-location-0').show();

    function show_featured(n) {
    $('.featured').hide();
    $('#featured-location-' + n).show();
    $("#ww_img").hover(
    function () {
    timer.stop();
    },

    jQuery.timer(200, function(timer) {
    var current = parseInt($('.featured:visible').attr('id').split('-')[2]);
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    }

    $('.featured').hide();
    $('#featured-location-' + next).show();
    });
    );
    });

    function show_featured(n) {
    $('.featured').hide();
    $('#featured-location-' + n).show();
    }

    jQuery.timer(200, function(timer) {
    var current = parseInt($('.featured:visible').attr('id').split('-')[2]);
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    }

    jQuery.timer(200, function(timer) {
    var current = parseInt($('.featured:visible').attr('id').split('-')[2]);
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    }

    $('.featured').hide();
    $('#featured-location-' + next).show();

    $("#ww_img").hover(
    function () {
    timer.stop();
    },
    jQuery.timer(200, function(timer) {
    var current = parseInt($('.featured:visible').attr('id').split('-')[2]);
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    });
    });

    # The rotator doesn't work with this. It doesn't even show up.
    $('.featured').hide();
    $('#featured-location-' + next).show();
    });
  2. @albatrocity albatrocity revised this gist Mar 27, 2009. 1 changed file with 23 additions and 1 deletion.
    24 changes: 23 additions & 1 deletion stop-timer.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,22 @@
    $(document).ready(function() {
    $('#featured-location-0').show();
    });

    function show_featured(n) {
    $('.featured').hide();
    $('#featured-location-' + n).show();
    }

    jQuery.timer(200, function(timer) {
    var current = parseInt($('.featured:visible').attr('id').split('-')[2]);
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    }

    $('.featured').hide();
    $('#featured-location-' + next).show();

    $("#ww_img").hover(
    function () {
    timer.stop();
    @@ -7,4 +26,7 @@
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    });
    });
    });

    # The rotator doesn't work with this. It doesn't even show up.
  3. @albatrocity albatrocity revised this gist Mar 27, 2009. 1 changed file with 5 additions and 7 deletions.
    12 changes: 5 additions & 7 deletions stop-timer.js
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,9 @@
    function () {
    timer.stop();
    },
    function () {
    jQuery.timer(200, function(timer) {
    var current = parseInt($('.featured:visible').attr('id').split('-')[2]);
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    }
    jQuery.timer(200, function(timer) {
    var current = parseInt($('.featured:visible').attr('id').split('-')[2]);
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    });
  4. @albatrocity albatrocity created this gist Mar 27, 2009.
    12 changes: 12 additions & 0 deletions stop-timer.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    $("#ww_img").hover(
    function () {
    timer.stop();
    },
    function () {
    jQuery.timer(200, function(timer) {
    var current = parseInt($('.featured:visible').attr('id').split('-')[2]);
    var next = current + 1;
    if(next >= #{@featured.size}) {
    next = 0;
    }
    });