I am using the javascript from this site to create a fading marquee on a site I'm buildingThe script fades from black to white, but since my page background is not white, I need to change the color it fades to. Supposedly I can, and the variable looks like this:
var m_FadeOut = 255;
var m_FadeIn=0;
var m_Fade = 0;
I used to use this function in text fading routines (tooltips/message tickers) but now I tend to use opacity (which is not compatible with all browsers but I find it more flexible as it allows images, URLs any style sheets). The function returns a color "between" 2 colors.
/*********************************************** * * Function : getColor * * Parameters :start - the start color (in the form "RRGGBB" e.g. "FF00AC") *end - the end color (in the form "RRGGBB" e.g. "FF00AC") *percent - the percent (0-100) of the fade between start & end * * returns : color in the form "#RRGGBB" e.g. "#FA13CE" * * Description : This is a utility function. Given a start and end color and * a percentage fade it returns a color in between the 2 colors * * Author : www.JavaScript-FX.com * *************************************************/ function getColor(start, end, percent) { var r1=hex2dec(start.slice(0,2)); var g1=hex2dec(start.slice(2,4)); var b1=hex2dec(start.slice(4,6));
var r2=hex2dec(end.slice(0,2)); var g2=hex2dec(end.slice(2,4)); var b2=hex2dec(end.slice(4,6));
/*** These are the simplest HEX/DEC conversion routines I could come up with ***/ /*** I have seen a lot of fade routines that seem to make this a ***/ /*** very complex task. I am sure somene else must've had this idea ***/
var hexDigit=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"); function dec2hex(dec){return(hexDigit[dec>>4]+hexDigit[dec&15]);} function hex2dec(hex){return(parseInt(hex,16))} /************************************************/
There are two radio buttons, sometimes one will be disabled, other times the other will be disabled. I would like to make a script that: First: Changes the color of surrounding text of the disabled radio button to the color grey. Second: Checks the other radio button.
This was my plan: I would make a script that: First: Removes all the current classes and add the class "greyed_out" (or better: change only the color of) the parent element, all siblings and children of siblings (if any) of the radio button that is disabled at that time.Second: Sets the attribute "checked to the other radio button". I made a script, but when I set the bottom radio button to disabled the script doesn't work:
have been trying to rework this to call additional, independent sets of colors to cycle through (so it would loop thru a set of grays, a set of primary colors, etc). I would use perhaps a different function name in the HTML to call different sets of colors. If this is more complex than I think it is, I think 3 sets would be plenty. demo link of script in current state at bottom)
I have a form which contains FOUR text fields (e.g. TEXTFIELD1, TEXTFIELD2, TEXTFIELD3 & TEXTFIELD4). Each text field holds a HEX,DEC color value. ABOVE this form I have a table with TWO ROWS (ROW1 and ROW2). ROW1 should correspond with TEXTFIELD1, so that when the VALUE in TEXTFEILD1 is changed the background color of ROW1 will change to match the HEX,DEC VALUE entered in TEXTFIELD1. The same would happen with TEXTFIELD2 and ROW2. TEXTFIELD3 should be used to change the color of the TEXT inside ROW1 and TEXTFIELD4 should change the color of the TEXT in ROW2. I also wanted to know if it would be possible to achieve this without clicking any button.
------------------------------------------------------------------ | ROW1 | TEXT IN ROW 1 ------------------------------------------------------------------ | ROW2 | TEXT IN ROW 2 ------------------------------------------------------------------
TEXTFIELD1 <----HEXDEC VALUE GOES HERE to change color of ROW1---->[code]....
Is there code to just underline linked text to a certain color (red) but doesn't change the text color (it was white & when hovered over, it still stays white with a red underline)?
I want to make the date at the top right darker blue. But when I do that, all the light blue text next to the pictures also changes.
How can I control the color of the result of document.write output without changing the forground color of the entire page? Note my document write includes variables, so I was hesitant to imbed an html command in the document.write.
I'm trying to make buttons that change from one color to another when you click them and change back when you click them a third time. I wrote this page (http://cf.lehigh.edu/ems/test.html) but it only works on Firefox(Not IE or Chome, untested on safari or Opera). I'm using javascript to change the button colors. Is there another way to do this that works universal or another tool such as CSS?
I have installed Superfish menu module with Joomla ..Customization work more less fine ...I still have tenious problem like :
- How to have the main menu with the active color, when one of the sub-menu has been actived ?
- How to change the inactive color of the sub-menu without changing the inactive colro of the principal menu ...I did not found any information on the web ..
this is probably very simple but I cannot seem to figure it out and i tried looking around but i couldnt find anything on it.I am using Ajax insertrow which is working fine, however I have it in a loop and I want to alternate the rows colors, anyone know what call i have to use to change the background color of the current row?
what I want to be done is to get information from the input text area "level" and IF "level" is >= 10...for this one certain row, I want it to get the class #greenrow.Else, class = #redrow.
I am trying to create a place where if someone changes a color in a text field... (they can just enter 000000 or FFFFFF or anything like that) after they change it, (just off focus, or just click test button or whatever..) it changes a TD to match the color... so they know what the color looks like... its not neccessary to have it do this, but its a feature I think would be liked.
Javascript is not my strong point but I have a little problem with a function.
I have ASP code that displays form variables for x number of users. Depending on the radio button they click, I highlite some text in red over another form variable to show that it's mandatory. I use a <span> tag for the text and a Javascript function to change the text color of that user's mandatory field.
My Javascript call passes (i) to show which user I'm talking about but the problem is I don't know how to change that user's text color. Here's my function
<script language="JavaScript"> <!-- function ChangeTextColor(num){ membertype_1.style.color='red' memberno_1.style.color='black' lastname_1.style.color='black' }
//--> </script>
As you see, I'm not using the parameter "num" so it only works for the first user. I need to know how to make it dynamic...I've tried