The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Fancy Theme Changer Script Help

2 posters

Go down

Fancy Theme Changer Script Help Empty Fancy Theme Changer Script Help

Post by MrMega July 27th 2010, 3:26 pm

Is there any way to combine this css & html script:

Code:
<style type="text/css">
ul {
   margin: 0;
   padding: 0;
   list-style: none;
   width: 150px;
   }
ul li {
   position: relative;
   }
li ul {
   position: absolute;
   left: 149px;
   top: 0;
   display: none;
   }
ul li a {
   display: block;
   text-decoration: none;
   color: #777;
   background: #fff;
   padding: 5px;
   border: 1px solid #ccc;
   border-bottom: 0;
   }
ul {
   margin: 0;
   padding: 0;
   list-style: none;
   width: 150px;
   border-bottom: 1px solid #ccc;
   }
li:hover ul { display: block; }
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace»
   (" over", "");
  }
  }
  }
 }
}
window.onload=startList;
li:hover ul, li.over ul {
   display: block; }
/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; }
* html ul li a { height: 1%; }
/* End */


</style>
<ul id="nav"><li><a href="#">Theme Changer</a>
      <ul>
        <li><a href="#">Original</a></li>
        <li><a href="#">Black Gold</a></li>
        <li><a href="#">Mac Blue</a></li>
        <li><a href="#">Cloudz</a></li>
        <li><a href="#">Fresh Green</a></li>
      </ul>
    </li>
</ul>

with this script?:

Code:
<form id="switchform"><select name="switchcontrol" size="1" onChange="chooseStyle(this.options[this.selectedIndex].value, 60)"><option value="none" selected="selected">Default style</option><option value="theme2">Black Gold</option><option value="theme3">Mac Blue</option><option value="theme4">Coudz</option><option value="theme5">Fresh Green</option></select></form>

This is for a theme changer on a forum.
I want to make is so on the first script, when you select a theme, it changes to that theme using the 2nd script. Thanks to anyone who could help Very Happy



Last edited by MrMega on July 28th 2010, 4:05 pm; edited 1 time in total
MrMega
MrMega
Forumember

Male Posts : 981
Reputation : 11
Language : English, Polish, HTML, BBCode
Location : New York, United States

Back to top Go down

Fancy Theme Changer Script Help Empty Re: Fancy Theme Changer Script Help

Post by MrMega July 28th 2010, 4:04 pm

Bump.
MrMega
MrMega
Forumember

Male Posts : 981
Reputation : 11
Language : English, Polish, HTML, BBCode
Location : New York, United States

Back to top Go down

Fancy Theme Changer Script Help Empty Re: Fancy Theme Changer Script Help

Post by Guest July 28th 2010, 4:14 pm

I dont know something like this ;D. but if you change the "nav" in this part "navRoot = document.getElementById(">>nav<<");" to "switchform" Smile
avatar
Guest
Guest


Back to top Go down

Fancy Theme Changer Script Help Empty Re: Fancy Theme Changer Script Help

Post by MrMega July 28th 2010, 4:26 pm

Thanks but need a little more help than that, lawl.

OK I changed the script a little:

Code:
<style type="text/css">
ul {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 150px;
  }
ul li {
  position: relative;
  }
li ul {
  position: absolute;
  left: 149px;
  top: 0;
  display: none;
  }
ul li a {
  display: block;
  text-decoration: none;
  color: #777;
  background: #fff;
  padding: 5px;
  border: 1px solid #ccc;
  border-bottom: 0;
  }
ul {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 150px;
  border-bottom: 1px solid #ccc;
  }
li:hover ul { display: block; }
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("switchform");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace»
  (" over", "");
  }
  }
  }
 }
}
window.onload=startList;
li:hover ul, li.over ul {
  display: block; }
/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; }
* html ul li a { height: 1%; }
/* End */


</style>
<ul id="switchform"><li><a href="#">Theme Changer</a>
      <ul>
        <li><a href="#">Original</a></li>
        <li><a href="#">Black Gold</a></li>
        <li><a href="#">Mac Blue</a></li>
        <li><a href="#">Cloudz</a></li>
        <li><a href="#">Fresh Green</a></li>
      </ul>
    </li>
</ul>

Anyone?
MrMega
MrMega
Forumember

Male Posts : 981
Reputation : 11
Language : English, Polish, HTML, BBCode
Location : New York, United States

Back to top Go down

Fancy Theme Changer Script Help Empty Re: Fancy Theme Changer Script Help

Post by Guest July 28th 2010, 4:40 pm

Since no one answering you, try look at this Smile
http://www.dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm
avatar
Guest
Guest


Back to top Go down

Fancy Theme Changer Script Help Empty Re: Fancy Theme Changer Script Help

Post by mollu July 28th 2010, 5:09 pm

Looks like a very good way to do it! Very Happy
avatar
mollu
New Member

Posts : 5
Reputation : 0
Language : En/Ger/Et

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum