SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamically changing product options

    Hi everyone,
    I was wondering if something similar to this page is possible to do in JavaScript? http://www.gap.com/browse/product.do...001&pid=378650

    Basically, I just want to know how to add the functionality where in the site above, when you select a clothing color, only the sizes that are available for that color would be highlighted/outlined while the sizes that aren't available for that color are dull/grayed-out. For example on the default-selected tan/camel color, sizes XS, S, L, XXL, XXXL appear to be available in this color, but when I click/select the black color, the available sizes change to XS, S, L, XL, XXL (please check out site link above to understand what I'm talking about).

    In the chance that this is impossible to do in JavaScript, I would at least appreciate a point in the right direction as how to go about with adding this feature to a site. Thanks if anyone can help!

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sakura_r0se View Post
    Hi everyone,
    I was wondering if something similar to this page is possible to do in JavaScript?
    Yes, and if you check the source you will notice that they did that with JavaScript.

  3. #3
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria View Post
    Yes, and if you check the source you will notice that they did that with JavaScript.
    For some weird reason, I was having problems viewing the source code before, but now all seems well so I guess I'm going to start looking at the source code now and trying to break things down.

    Thanks for stating the obvious! LOL

    I'll post again if I've been successful in getting it to function or not.


    [Edit 01/09/07]
    I just wanted to add that after looking through every little bit of code, it seems that the website uses XML and references databases, etc. in addition to JavaScript. However, I think I know how to create this effect now, or at least something similar to it.
    [/Edit]
    Last edited by sakura_r0se; Jan 9, 2007 at 11:43.


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
  •