Jump to content

Need Help with a Script


Chocolate570

Recommended Posts

All is good. :) I can understand why you like the effects of your original script, a smoother transition I think.Drop a line please if you folks work out a formula that allows the same transition with a color incrementation(is that a word)? ..The project was a good exercise for me at any rate.And I'll leave a link to my latest attempt to imitate the original script.(With your parameters of course.)http://webfeet.siteburg.com/1colorBanner.htmlBe sure to hit the refresh or you could be working off of cache...

Link to comment
Share on other sites

O.M.G. That is amazing! Almost exactly what i want! The only thing that would be cool is if you could make the text fade out and then come back in with the color. The other script can go eat itself. This is exactly what i need! :) Tysm!

Link to comment
Share on other sites

You're Welcome.I think you are out of wishes in this thread... :) (I'm kidding of course)Well drive this around the block:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head>  <title>Banner Colorizer</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  <style type="text/css">.noShow{ display: none;  width: 350px;  padding: 5px; }.yesShow{ display: block;  width: 350px;  color: #CA02B6;   cursor: pointer;  padding: 5px; }  </style><script type="text/javascript">var bgArray = ['#FDC1F7','#FDB0F5','#FD9FF3','#FD8EF2','#FD79F0','#FD55EC','#FD2FE9','#EA02D2','#FD2FE9','#FD55EC','#FD79F0','#FD8EF2','#FD9FF3','#FDB0F5','#FDC1F7','#FFFFFF'];var fgArray = ['#EA02D2','#FD2FE9','#FD55EC','#FD79F0','#FD8EF2','#FD9FF3','#FDB0F5','#FDC1F7','#FDB0F5','#FD9FF3','#FD8EF2','#FD79F0','#FD55EC','#FD2FE9','#EA02D2','#CA02B6'];var fadeArray = ['#FD55EC','#FD79F0','#FD8EF2','#FD9FF3','#FDB0F5','#FDC1F7','#FDACF4','#FEF1F9','#FFF0FF','#FFFFFF'];var divArray = ['aDiv','bDiv','cDiv'];var prev_banner = 0;var curr_banner = 0;var f = 0;  //tracks the text fadevar j = 0;//uncomment the following line if you want to use stop(also lines 40, 107-109)//var stop = false;function mkBG(toggle){//if(stop) return;if(toggle){  document.getElementById(divArray[prev_banner]).className = 'noShow';  document.getElementById(divArray[curr_banner]).className = 'yesShow';  }var banner = document.getElementById(divArray[curr_banner]);         banner.style.background = bgArray[j];  banner.style.color = fgArray[j];  j++;  if(j == bgArray.length && curr_banner == divArray.length - 1){    prev_banner = curr_banner;     curr_banner = 0;    j = 0;    setTimeout('fadeText()', 1500);    return;    }      else if(curr_banner < divArray.length && j == bgArray.length){    prev_banner = curr_banner;     curr_banner++;    j = 0;    setTimeout('fadeText()', 1500);    return;    }setTimeout('mkBG()', 25); }function fadeText(){var banner = document.getElementById(divArray[prev_banner]);         banner.style.color = fadeArray[f];  f++;  if(f == fadeArray.length){   f = 0;   setTimeout('mkBG(true)', 300);   }  else   setTimeout('fadeText()', 20);}function init(){document.getElementById('xDiv').className = 'noShow';setTimeout('mkBG(true)',50);}window.onload = init;</script>  </head><body> <p>  Customize your colors. </p> <div style="width:360px;">   <div class="yesShow" id="xDiv">   Your initialize message here..   </div>    <div class="noShow" id="aDiv" title="Google" onclick="window.location = 'http://www.google.com';">   This ticker message is for people who want to Google   </div>   <div class="noShow" id="bDiv" title="Yahoo" onclick="window.location = 'http://www.yahoo.com';">   This ticker message is for people who want to Yahoo   </div>   <div class="noShow" id="cDiv" title="Ask Mr. J" onclick="window.location = 'http://www.ask.com';">   This ticker message is for people who want to AskJeeves   </div> </div><!--<input type="button" value="stop" onclick="stop = true;">--></body></html>

Let me know if it needs adjustments, and thanks to Jonas for the codebox tip.

Link to comment
Share on other sites

Glad it was helpful Chocolate570.(Pssst...)Jonas Mail DynamicDrive and tell them to block Chocolate570's ip address before I go insane..ooops too late. :ph34r: And look here Chocolate570, I'm an advanced member now, I say Thanks So Much to you. :)

Link to comment
Share on other sites

Huh, I have IE6, FF, NN and Opera...http://www.opera.com/download/:)I'm currently looking forward to Opera 9, which will have xslt support, so I can start learning writing AND displaying xml...

You know you don't need XSL to display XML:http://www.w3schools.com/xml/xml_data_island.aspBut XSL does give you alot of confusion . . . I mean control over the way XML gets displayed. :) (sorry, just recently went through a load of legacy code from a previous developer that robbed my current employeer by billing for a job he claimed could only be done in XML/XSL just so he could learn XSL)
Link to comment
Share on other sites

You know you don't need XSL to display XML:http://www.w3schools.com/xml/xml_data_island.asp

"With Internet Explorer, XML can be embedded into HTML pages in Data Islands."Yeah, no, I don't do IE only hacks, sorry... :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...