Results 1 to 4 of 4

Thread: Need help to "simplify" a script!!!

  1. #1
    Join Date
    Feb 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need help to "simplify" a script!!!

    Hey Guys

    I currently use the script thats on www.lagerhaus.se (look in source code and check for the javascript) I havent built it so I have no idea how to extract unessecary stuff like onload (Does anyone really use it anymore?)

    Everytime I shall add stuff i must tel lthe script wich div's who should be shown and wich should be hidden like this

    Code:
    <a href="#" onClick="MM_showHideLayers('info','','hide','bild01','','show','bild02'">

    and this is starting to take to much time. What I want to know is if there are any other way to do this, maybe like
    Code:
    <a href="#" onClick="MM_showHideLayers('info','','show','*','','hide'>
    so It's hide all the other divs (since the divs are at the same place Z-index won't do the trick here)

    Can anyone please post some code that I can use or point me to a new script that does the same thing but easier?

    Thanks in advance

    /H2o

  2. #2
    Join Date
    Oct 2006
    Location
    AL
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    you can set a javascript variable such as
    var showing = 'info';

    and when you swap your layer, change the showing var to the one you want to show, and at the same time, hide the current value of showing:
    Code:
    function MM_showHideLayers(id){
         document.getElementById(showing).style.display = 'none';
         document.getElementById(id).style.display = '';
         showing = id;
    }

  3. #3
    Join Date
    Feb 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You coulden't be so kind as to paste a .html page with the script intergated since I'm not a good coder (I know how to change some varibles and to copy and paste) good at coding. I just want some dummy file so i can add myself then.

    Thanks in advance!

    /H2o

  4. #4
    Join Date
    Feb 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Please? anyone?

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
  •