#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    30
    Rep Power
    12

    css stylechange query


    Hi,
    I have the following at the moment to switch between stylesheets on my page. Please could someone tell me how to turn this into a drop-down option box, rather than a list of links?
    <div class="gentable">

    <b>Stylechanger</b><br />

    <a style="menu" href="#" onclick="setActiveStyleSheet('sixblocks'); return false;">Default</a> <br />

    <a href="#" onclick="setActiveStyleSheet('fire'); return false;">Fire</a> <br />

    <a href="#" onclick="setActiveStyleSheet('forest'); return false;">Forest</a> <br />

    <a href="#" onclick="setActiveStyleSheet('ice'); return false;">Ice</a> <br />

    <a href="#" onclick="setActiveStyleSheet('stripe'); return false;">Stripe</a> <br />

    </div>
  2. #2
  3. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,009
    Rep Power
    2791
    onChange
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    30
    Rep Power
    12
    Hi,
    I'm afraid I don't know much javascript & don't understand what you mean -- could you explain a bit more?
  6. #4
  7. :(){ :|:&};:
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Germany
    Posts
    297
    Rep Power
    12
    You should add this to the onchange event in your select box:

    Code:
    functionName(this.form.SelectName.options[this.SelectName.options.selectedIndex].value)
    This basicly calls a javascript function each time you select an option from the drop down list and in this function you can define what to do with the value submitted.

    For example this function:

    Code:
    function(mix) {
     self.location.href=mix;
    }
    Would redirect the user to a page with the address that is the value of the droplist menu
    regards >_<

    ws. fgeller.de
    em. felix@fgeller.de

IMN logo majestic logo threadwatch logo seochat tools logo