Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 7 of 7
  1. #1

    Default Prototype Framework/Javsascript help..

    Hey, I'm currently working on coding a layout I designed recently. I have a featured area where there are 4 tabs and an area for content I've managed to use the prototype framework to bring the content in with ajax and change the selected tab to the select tab css class I'm wanting to change the css class of the tab back to un-selected when another tab is selected but I'm having trouble. Can anyone help me?

    My prototype code:
    Code:
    function loadTab(name)
    {
        new Ajax.Request('?tab=' + name,{
            method: 'get',
            onSuccess: function(transport)
            {
                $('feat_tab_' + name).className = 'feat_tab_s';
                $('feat_cont').innerHTML = transport.responseText;
            }
        });
    }
    It changes to the selected tab class, but i need a way of changing it back when a new tab is selected.

    Thanks, Jamie.

  2. #2
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Why dont you use Ajax.Updater :S?
    Coming and going...
    Highers are getting the better of me

  3. #3

    Default

    Quote Originally Posted by MrCraig View Post
    Why dont you use Ajax.Updater :S?
    Uh, can you explain? hahaha sorry i'm uber crap with javascript and I've only used this framework once, I'll have a look in the documentation tho. Cheers

  4. #4
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Dojo framework, use that if you're gonna use any framework, prototype is far too bulky.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

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

    Latest Awards:

    Default

    Prototype isn't really bad if you either utilize all the functions/features it offers, if you just use a snippet of code from the .js file (Such as to use $()) or if you learn to use it properly.

    Prototype itself is the best Javascript framework/library out there (and isn't really that laggy - 60kb or so I think? It starts to get laggy when you throw in scriptaculous, etc), but I do have to say jQuery is also very good I personally haven't checked out the Dojo framework, so I might do so now..
    Last edited by Invent; 09-04-2008 at 04:54 PM.

  6. #6

    Default

    Quote Originally Posted by Lolcopters View Post
    Dojo framework, use that if you're gonna use any framework, prototype is far too bulky.
    Might just do that.
    I'm not sure if it's my connection or if it's prototype its self but there's a slight 1 second or so delay when changing tabs after the tab is clicked?

  7. #7
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by Jme View Post
    Might just do that.
    I'm not sure if it's my connection or if it's prototype its self but there's a slight 1 second or so delay when changing tabs after the tab is clicked?
    That would be ajax, it still has to load the page then display it to you.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

Posting Permissions

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