Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Animation issue...

  1. #11
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well to start with my script can easily be put to one function using some extra variables and what not.... And I do not know how your script requires the arguments values to be set if you know what I mean....

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I do not know how your script requires the arguments values to be set if you know what I mean....
    It takes first an element, then a step by which to increase the spacing, then (optionally) upper and lower bounds, which default to 10 and 0, respectively. That second argument can also be made to default to 1, actually:
    Code:
    function growText(o, st, ub, lb) {
      var s = o.style,
        c = parseInt(s.letterSpacing),
        st = (typeof st === "undefined" ? 1 : st),
        ub = ub || 10,
        lb = lb || 0;
      if(!c)
        c = lb;
      c += st;
      if(c <= lb || c >= ub)
        return;
      s.letterSpacing = c + "px";
      setTimeout(function() { growText(o, st, ub, lb); }, 50);
    }
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #13
    Join Date
    Feb 2007
    Posts
    601
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No you undertood it wrong , what I meant is this -

    <html>
    <body>
    <span onclick="growText(????)".......

  4. #14
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    That would be written as, perhaps:
    Code:
    <span onclick="growText(this);">Text</span>
    Or to shrink:
    Code:
    growText(this, -1);
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •