Rainbow Text
Feb 11, 2006in the javascript kit page, theres a text effect called rainbow text. when i try it out, it wrks, but how do i change the font and centre it on the page!
View 3 Repliesin the javascript kit page, theres a text effect called rainbow text. when i try it out, it wrks, but how do i change the font and centre it on the page!
View 3 RepliesI had this idea to implement on the Kid's Activities page on the website for work and after hours and hours and hours of laboriously slaving over code (yeah, right... more like an hour, most of which was spent formatting and commenting the code) I just had to share it with people.
Really, it's not that long but it's pretty well documented throughout and adhears to the PHP/PEAR formatting rules so it looks rather spread out. The code itself probably isn't as streamlined as it could be, either... the "?:" operator instead of an IF-THEN statement and the FOR statement instead of WHILE-LOOP help, but there's always extra tweeks that could be made. I wanted to get the idea out there, though.
I've also posted the code on the cyberdevdigest website at cyberdevdigest.com/code/javascript/rainbow_links.html (http://www.cyberdevdigest.com/code/javascript/rainbow_links.html).
-Tim
<script type='text/javascript'>
<!--
// JavaScript code to produce strobing rainbow-colored links
// on mouseovers. Coded by Timothy Boronczyk, © 2003.
// declare list of colors as a global array (goldenrod used
// because yellow was too difficult to against lighter
// backgrounds)
var colors = Array('red', 'orange', 'goldenrod', 'green',
'blue', 'purple');
// declare color pointer (current color in array by position)
var p_color = 0;
function strobe(x)
{
// set pointer to next color (reset pointer to beginning
// if current position is at the end of the list)
p_color = (p_color == 5) ? 0 : p_color + 1;
// set link color
document.links[x].style.color = colors[p_color];
return true; // no errors
}
function rainbow(link, toggle)
{
// determine which link called this function by matching
// the current key of the DOM's link array
for (id = 0; link != document.links[id]; id++);
if (toggle)
{
// identify setInterval function by name cycle and
// repeatedly call change_color passing current link
// array key
cycle = setInterval('strobe(id)', 100);
}
else
{
// terminate cycle calls
clearInterval(cycle);
// reset link color (assuming that green was original
// color)
link.style.color = 'green'
}
return true; // no errors
}
//-->
</script>
call using onmouseover and onmouseout event handlers, such as in this example:
<a href='link.html' onmouseover="rainbow(this, 1);"
onmouseout="rainbow(this, 0);">CLICK HERE</a>
I am trying to create a chrome extension that can pass text from a text box to a webpage text box. Basically my company has an intranet site where you can search for an employee. The url does not display the search terms so i cant just append to it. Since I cant really work on this outside of work (its an intranet site) i have tried replicating it from home using the let me google that for you (www.lmgtfy.com) site.
View 2 Replies View RelatedI have some Javascript which says this:
Now that is fine when the text is only one line long. Suppose it's longer? What I want to do is have Javascript give the variable contentString its text from a hosted text file in a similar manner to the way Javascript can insert more Javascript using a hosted .js file.
I illustrate what I need to do using some "dummy" javascript:
I have a form with 9 text fields and a text area. What I want to do is replace the text in the text area depending on how many fields contain text. For example my text boxes are named 1 to 9, if the user enters text in the first five boxes I want the text area to auto fill with 'you have selected boxes 1 to 5' if the user selects all nine it will say 'you have selected 1 to 9', therefore, the user must complete the text boxes in order. I have it working with an onchange event but i have a button on the form to also auto fill the text boxes and it does not work if this is clicked
View 7 Replies View RelatedAs of right now I have a code that will work in IE but wont work in FireFox...go figure. Basically what I want to have happen is when you type in an area code it will provide an output in a predetermined area of the page.
For Example:
Input- 512
Output - Austin, TX
The code that I have doesn't work with firefox and I was just wondering if there was a code that would allow that to happen.
Would u pls let me know whether the following is possible or not: User can be able to insert text on a text-box or text-area(form) as usually we use text-area to do so. But I want to put some readonly text using an open and close tag
for example: <ro>This is readonly text</ro>insert your text here Can I be able to make the text inside <ro>..</ro> tag readonly, it means user can't be able to modify or delete this readonly text. readonly text length not fixed. only way to recognize the readonly text is the <ro> tag.
I have a text field (field1) already displayed on the HTML page. However, there's a link where you can add additional text fields to the page as well. When the link is clicked, the second text field is added successfully (field2), and when the link is clicked again, the third text field (field3) is added successfully. However, the third field does not add itself to the page, and the text for anything greater than a third field also isn't displayed after. This obviously means that my "fields" variable is not working right
<script language="javascript">
fields = 1;
function addMore() {
if (fields = 1) {
document.getElementById('addedMore').innerHTML = "<input type='text' name='field2' size='25' /> <span>Field 2.</span>";
[Code]....
I need to a code to do the following.
There is a Text Area that user can enter text. assume that user enter something and put a dot Following values should be populate in a drop down at the place where dot locate .
like when we get the string object using Net Beans IDE and when we put "Object." , drop down will be displayed with available methods for that particular object. idea is to build a editor using java script.
I am new to javascript, and am having an issue, which I'm sure is elementary.. I found a script for expandable content, it suffices fine. As it stands, the script toggles images onclick. For example, whence the menu is collapsed, it displays "plus.gif" next to it, and when the menu is expanded, it displays "minus.gif" next to it.
Basically, what I would like to know is, thus: how would I change it to display text icons next to it? For example, in place of "plus.gif" I should like it to display "+" as actual text. I've dredged a number of places, however, I've found nothing. Furthermore, I cannot figure out how to do it.
I m having a text data of around 6 page length in a text editor...I want to print dat data using window.print. For that i displayed dat data in a html page and used window.print(). Bt my client wants dat some line spaces shud be inserted first in the starting of the page and on the second page also...After that the printing shud be normal... How can i set the page in such a format...?
View 1 Replies View RelatedI want to get the cursor start and end position of a selected range in a text-field or text-area. i tried lot of functions in various forums. but when the last character of the selection is a new line character JavaScript ignore it in IE6. any one having idea ?
View 1 Replies View RelatedIs it possible to have a text box input searching for the entered text on another webpage in the same way Find In Page would do? I have a webpage that I want users to input an item, and that this will open the targeted webpage and bring you to (and highlight) the matched item(s) like find in page does. Is this possible or is the easiest way to just make users open the link to the target page and just complete the find in page search there?
View 1 Replies View RelatedHave a small problem with a cms whereby when i try to insert default text into an input text field using the "value" attribute it gets deleted. I was thinking to force insert the text in there when the page load with javascript but not sure exactly how...
<p><input name="vericode" id="vericode" value="This text doesn't display!!" type="text" onclick="value=''"/></p>
Im trying to nut out a check box validation
The goal- the check box as default is unchecked and when checked validates a text area for text
CODE:
<h1>November<span>2009</span></h1>
making a variable equal the h1 html() without the span text.
// equals 'November2009'
var monthDelete = $('h1').html();
// I need just 'November'
I am creating a small CMS module for a client. I created a little form and when they click Submit, it goes straight out into an include (.inc) file, which is connected to the web page to be displayed.
The trouble I am having is that I'd like to create an additional button that will insert some text (certain html tags to make their life easier, etc) - I got it to work, actually. The script executes and the text is inserted - but once the script runs and the page refreshes (or whatever it does), the text then disappears. The only way I can seem to get it to stay put is when I use "onmouseup" instead of "onclick" - which means that every time the user accidentally mouses over the thing, it inserts the text.
I currently have multiple combos ofimage with a description text below it.I want to lay them out inrowsand inline. So if the width of page is not enough the next one should startbeginning of next row. Each image and text is currently house by a div with float left and a set width, but if you look at the attached screenshot (1.jpg), The Oracle - eBusiness Suite gets stuck because of the differentsheight due to text size and if I set a height too, then some of the text gets covered up (2.jpg). I was thinking if I can maybe use J Query to automatically adjust height to divs on the same rowto fit the biggest text size on that row?Evenjust changing all divs to that heightbe would be ok if it'seasier.
Attachments
2.JPG
Size : 29.87 KB
Download : 544
1.JPG
Size : 26.5 KB
Download : 503
So I have the following xml:<ingredient name="rice"><us>1 cup</us><metric>250 mL</metric> of uncooked Korean rice</ingredient>
I want grab only the "of uncooked Korean rice" part. I tried to use text() but it would grab the text from inside the "us" and "metric" element.
i m using jquery datepicker .it's works fine in all other browser except IE the only problem with IE is that the when i m using datepicker it wont fire my text change events IE.works fine in all other browse . if i remove plugin then IE fires text change .so the only problem with datepicker + IE my page is .aspx and i m using .net
View 2 Replies View RelatedI have a text box.I need to
1) search the database for the words user is typing in the text box. This will happen with each key press.
2) if there is a match - I need to change the text color.
How can I achieve this?
I have a form setup so that selecting a radio button opens a specific text field. The problem is if the user starts to enter information, then switches to a different radio button (perhaps they chose the wrong radio to start), the text they already started to enter on the previous textfield doesn't get cleared. This will be a problem later when inserting to sql.
[Code]...
Alright, I'm using a Rooh.It WordPress plugin right now, but I don't like the way they do it, so I want to write my own code to do something similar.
I want the user to be able to select the text they want to highlight, and the background color of that text changes to whatever color they have selected.
How can I do this in JavaScript?
im trying to implement a login screen similar to Facebook. What i mean by this is i want the username and password fields to have text in them until the user selects the textfield. If the user does not type anything in the textfield the the onblur will automatically change it back, but if the user has typed something in then i want the text to be left alone.At the moment the onblur always changes the value of the textfield. Im not sure how to solve this.(code i am using is below)
Code:
<input name='username' type='text' size="10" value="username" onfocus="this.value=''" onblur="this.value='username'"/>
[code]....
The javascript below is looking for the word 'margaret thatcher' in the body and surrounding it with a link. It's lower-case but the script is ignoring the case so that won't matter. But, the problem is that because Margaret Thatcher is a proper noun, it will be capitalized in the body text yet replaced with lower-case text. How can I modify this script to look for the word while ignoring the case but use the same text it found as the replacement instead of using the text object?
[Code]...
I am trying to truncate some text within a 'span' in order to create a 'more/less' button to show/hide the additional. I effectively want to turn this:
[Code]...