Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default Trouble with Scriptaculous [REPOST]

    I forgot about the coding communities stupid rule only letting members of the CC (Simon and Oli aint it?) post and nobody else.

    I am have trouble fading a div from my ajax loaded page.

    Moved by Invent (Forum Moderator) from Designing & Development: Please post in the correct forum next time, thanks .
    Last edited by Invent; 08-07-2008 at 05:14 PM.

  2. #2
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Just letting you know that I took a 2 week break from moderating and posting in the CC section that's why you haven't got a reply.

    I've also moved your thread to a category that's more suitable.

    Once I'm officially back to helping I'll try to post a fix for you.
    Last edited by Invent; 08-07-2008 at 05:15 PM.

  3. #3
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    Just letting you know that I took a 2 week break from moderating and posting in the CC section that's why you haven't got a reply.

    I'll also move your thread to a category that's more suitable.
    Okay then cheers x

    But this problem is doing my nut

  4. #4
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    Just letting you know that I took a 2 week break from moderating and posting in the CC section that's why you haven't got a reply.

    I've also moved your thread to a category that's more suitable.

    Once I'm officially back to helping I'll try to post a fix for you.
    Woah, time has been running slow.. or you and oli haven't been that active other than them 2 weeks.

  5. #5
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Quote Originally Posted by Independent View Post
    Woah, time has been running slow.. or you and oli haven't been that active other than them 2 weeks.
    They should let me in this coding community.

    -----------

    This fading method isn't that good, so I'd probably look into jquery fading.

    Code:
    function changeOpacity ( id, opacStart, opacEnd, millisec )
    {
        var speed = Math.round ( millisec / 100 );
        var timer = 0;
        
        if( opacStart > opacEnd )
        {
            for( i = opacStart; i >= opacEnd; i-- )
            {
                setTimeout ( 'changeOpac(' + i + ",'" + id + '\')', ( timer * speed ) );
                timer++;
            }
        }
        else if( opacStart < opacEnd )
        {
            for( i = opacStart; i <= opacEnd; i++ )
            {
                setTimeout ( 'changeOpac(' + i + ",'" + id + '\')', ( timer * speed ) );
                timer++;
            }
        }
    }
    
    function changeOpac ( opacity, id )
    {
        var object = document.getElementById( id ).style; 
        object.opacity = ( opacity / 100 );
        object.MozOpacity = ( opacity / 100 );
        object.KhtmlOpacity = ( opacity / 100 );
        object.filter = 'alpha(opacity=' + opacity + ')';
    }
    To change the opacity of an object basically you call this func:

    changeOpacity ( 'id', 0, 100, 500 );

    Red -> The ID of the object, say we called the ID 'Bob'
    <div id="bob"></div> (doesn't have to be a div btw.)

    Orange -> Start opacity, say you want to fade from 0% (cant see)
    Blue -> End opacity, you want the end result to be 100% (you can see)

    Pink -> The amount of time you want the fade to go on, in milliseconds ( 500 = 0.5 seconds.. 1000 = 1second
    Any problems, post your reply.
    Last edited by Protege; 09-07-2008 at 10:08 AM.
    Hi, names James. I am a web developer.

Posting Permissions

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