Forums

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

Home Forums JavaScript Javascript Animation Effect

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

    i found a really useful javascript.. here

       $(document).ready(function () {
    $('body').mousedown(function (event) {
    $(this)
    .data('down', true)
    .data('x', event.clientX)
    .data('scrollLeft', this.scrollLeft);

    return false;
    }).mouseup(function (event) {
    $(this).data('down', false);
    }).mousemove(function (event) {
    if ($(this).data('down') == true) {
    this.scrollLeft = $(this).data('scrollLeft') + $(this).data('x') - event.clientX;
    }
    })
    });

    $(window).mouseout(function (event) {
    if ($('body').data('down')) {
    try {
    if (event.originalTarget.nodeName == 'BODY' || event.originalTarget.nodeName == 'HTML') {
    $('body').data('down', false);
    }
    } catch (e) {}
    }
    });

    Jsfiddle

    it like an iphone scroller but without animation effect. so can i know how to make it animated.. Jsfiddle will be great.

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