The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Fancy Theme Changer Script Help

View previous topic View next topic Go down

Fancy Theme Changer Script Help

Post by MrMega on Tue Jul 27, 2010 7:26 am

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 Wed Jul 28, 2010 8:05 am; edited 1 time in total
avatar
MrMega
Forumember

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

Back to top Go down

Re: Fancy Theme Changer Script Help

Post by MrMega on Wed Jul 28, 2010 8:04 am

Bump.
avatar
MrMega
Forumember

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

Back to top Go down

Re: Fancy Theme Changer Script Help

Post by Guest on Wed Jul 28, 2010 8:14 am

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

Guest
Guest


Back to top Go down

Re: Fancy Theme Changer Script Help

Post by MrMega on Wed Jul 28, 2010 8:26 am

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?
avatar
MrMega
Forumember

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

Back to top Go down

Re: Fancy Theme Changer Script Help

Post by Guest on Wed Jul 28, 2010 8:40 am

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

Guest
Guest


Back to top Go down

Re: Fancy Theme Changer Script Help

Post by mollu on Wed Jul 28, 2010 9:09 am

Looks like a very good way to do it! Very Happy

mollu
New Member

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

Back to top Go down

View previous topic View next topic Back to top


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