JavaScript - Blinking Text In Javascript
I have written a small code in Javascript which does the work of blinking all the content inside any tag with the name 'blink'
here is the code <html> <body> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <p name="blink" style="visibility: visible;">This text blinks using Javascript</p> <script type="text/javascript"> function blinkText() { var x=document.getElementsByName('blink'); for(i=0;i<x.length;i++) { if(x[i].style.visibility=='visible') x[i].style.visibility='hidden'; else x[i].style.visibility='visible'; } } setTimeout('blinkText()',500); </script> </body> </html> I use a Ubuntu system and work on Mozilla 3.6.18 This hides the text successfully but does not display it again What can be wrong here? Can anyone please help me Similar TutorialsHi Everyone, I am interested to create one neon light effect using javascript (let's call it a club logo animation), Now I know, that I can achieve image blinking effect using javascript, but when I use this effect, the image blinks continuously. I would like to blink it only for 2-3 times. also I would like to blink four images, one after anohter, and sometimes two together. I know it seems bit complicated, but not for experts like this forum have Thanks in advance for your help. I would like to create a caret for a textarea like the one he http://www.dynamicdrive.com/forums/s...4576#post74576 it works great if I want a white background but when I changed it to black and tried to change the textarea's text color to yellow: Code: <textarea type="text" id="setter" style="color:yellow;"onkeydown="writeit(this, event);moveIt(this.value.length, event)" onkeyup="writeit(this, event)" onkeypress="writeit(this, event);"></textarea> I don't see anything on the screen other than the blinking cursor http://www.primedesigning.com/ellis/ I'm working on a site for a friend and I can't figure out what's causing this blinking! Hover over one of the 3 pictures in the "Products" section to see what I'm talking about (the larger, expanded picture and its border blinks on and off). BTW, this site is still under construction. Any design ideas you guys may have would be appreciated too Thanks for any help! Hi Community, I am running simple web cam streaming to html. Let me explain how it works: First C code grabs frame from web cam and PHP code send the image to the client where exists receiver php code. It saves the submitted image to disk and javascript updates image every 0.1 sec or less. it is working fine but there is blinking. So I changed Javascript to avoid blinking (changed to other script). In this case streaming is fine but after 2-5 sec it stops updating. here is script: <head> <title> Streaming</title> </head> <body> <!-- <img name="frame" src="" border="0" /> --> <img src="" id="webcam1" width="640" height="480" border="5" alt="Camera1"/> <script language="javascript"> document.images.webcam1.src = "http://my_IP_address/img.jpg"; document.images.webcam1.onload = Start; function LoadImage() { uniq1 = Math.random(); document.images.webcam1.src = "http://my_IP_address/img.jpg?"+uniq1; document.images.webcam1.alt = uniq1; } function Start() { setTimeout("LoadImage();", 70); } </script> </body> </html> Where is mistake? Why it stops updating after 2-5 seconds every time. Please help! Thank you As 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. Thanks! I have this code but it doesnt work: Code: <script type="text/javascript"> var number = 10; document.getelementbyid(number).value = number; </script> <input type="text" id="number" value=""> Can anybody help me out here? Dear all, Can anyone help me with this… I do not know if this is possible to be done… Instead of text: "Your favorite color is <b>Green</b> right?" I need to show form like this: Code: <form action="auto.htm" method="get" > Your state<br> <select name="statecode" id="statecode"> <option value="">Choose State...</option> <option value="AK">Alaska</option> <option value="AL">Alabama</option> <option value="AR">Arkansas</option> </select> <input type="submit" name="search" value="Get Quotes" /> </form> Thank you in advance This is code I wish to modify. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> html,body { padding:0; height:100%; } #right { width:500px; height:100%; background-color:#999; text-align:center; float:right; } #left { height:100%; margin-right:500px; background-color:#f00; text-align:center; } </style> <script type="text/javascript"> function change() { switch (document.getElementById("select").value) { case "1": document.getElementById("change").innerHTML = "Your favorite color is <b>Green</b> right?" break; case "2": document.getElementById("change").innerHTML = "Your favorite color is <b>Red</b> right?" break; case "3": document.getElementById("change").innerHTML = "Your favorite color is <b>Yellow</b> right?" break; } } </script> </head> <body> What is your favorite color <select onchange="change()" id="select"> <option value="">------</option> <option value="1">Green</option> <option value="2">Red</option> <option value="3">Yellow</option> </select> <div id="change" style="margin:10px;width:200px;height:100px;padding:5px;"> Original Text </div> </body> </html> Hi, I have a drop down menu, which you select an item and the text in a text box below displays according to what has been chosen from the drop down list. I have too much text in some case to appear in the text box, so i wanted to find some code so i can select different numbers for pages so i can display the information on different pages. Is this possible. Thanks how do i make those two lines go away in the backround? EDIT: UP! http://insidehb.com/main/default.html EDIT: Now works with ie I'm making a multiple choice test, it all must be on the same page but the user must not be able to see the next question until they finish the first and click continue. Is this possible in Javascript by manipulating form object or something else? Thanks for any suggestions. Been using document.write to write onto a html file.... What if I want to make the document.write Bold..? looked everywhere but can't find anywhere with legitimate information I can understand... Code: <DOCTYPE html> <html> <head> <title> Science Practical Report Writer </title> </head> <body> <script> var none = confirm("Scientific Report Automator!") var pracName = prompt("Name Of Report") var aim = prompt("Aim Of The Experiment") var hypothesis = prompt("Hypothesis?") var equiptment = prompt("Equiptment Used:") var method = prompt("Method Used...") var results = prompt("Results?") </script> <h1> Practical Report </h1> <script> document.write(pracName + "<br><br>") document.write("Aim:" + "<br><br>") document.write(aim + "<br><br>") document.write("Hypothesis:" + "<br><br>") document.write(hypothesis + "<br><br>") document.write("Equipment:" + "<br><br>") document.write(equiptment + "<br><br>") document.write("Method:" + "<br><br>") document.write(method + "<br><br>") document.write("Results:" + "<br><br>") document.write(results + "<br><br>") </script> </body> </html> All the printed (document.write) variables, are supposed to be bold Hello, I am building a web application that has quotes on it. I am planning on having all the quotes stored in a .txt file. A line space would separate the quotes. Example: "Blah Blah" "Idk what blah" "sure you do" Would this be using Javascript to pull the quotes from the txt file for use in my page be best? I need it to pull all the quotes. Reason for having it like this, I am also planning on having a random quote page where it just pulls 1 quote instead of showing all of them. I'm also open to other ideas here! David Faircloth I have a website, and I'[m learning Javascript. Somehow, I have to type a code in my browser like this javascript:enable:_Path Or something to enable the text box so that I can enter in it. Here is the details that I'm given. This below is in the actual website with the text box disabled ( cannot enter anything in it ) Code: <td width="40%"><strong><script>document.writeln(read_str("virtual_media", "STR_VM_CDROM_IMG_PATH"));</script></strong></td> <td><input type="text" id="_path" maxlength="128" disabled style="width:140px;" /> <label id="desc" style="font-size:11px"><script>document.writeln(read_str("virtual_media", "STR_VM_CDROM_IMG_PATH_DESC"));</script></label> </td> Below is me using Google Chrome to inspect the element, the text box. shareHost=document.getElementById("_shareHost"); path=document.getElementById("_path"); user=document.getElementById("_user"); pwd=document.getElementById("_pwd"); CheckRole(); So what do I type in the URL of my broswer to activate the _path form? Do I type javascript:document.getElementById("_path) OR ("path) IF I'm wrong, correct me the way I should do it. If theirs a program that allows me to do it easier, let me know. i have a javascript running on my web page, however the text in the input field is white, on a white background. making it unreadable. is there a way to change the text color for the script. site can be viewed he www.barren-county.net the script running is the toolbar at the bottom, more specifically the "Connect" app on the right, if you open it you see that the text field is white and text is invisible. here is the code i have: Code: <head> {S_HEADER_TAGS} <link rel="stylesheet" type="text/css" href="{THEME_PATH}/style/style.css" /> <!-- IF S_MAIN_MENU or S_ADMIN_CSSMENU --> <link rel="stylesheet" type="text/css" href="{THEME_PATH}/style/cpgmm.css" /> <!-- ENDIF --> {CSS_IE} <script src="http://cdn.wibiya.com/Toolbars/dir_0585/Toolbar_585555/Loader_585555.js" type="text/javascript"></script> </head> <body> can you help? Hello, Firstly - relatively new to javascript. I have seen many examples of code that will return a passed value in a currency format - however I have a sales form that is calculating values via a function in the text boxes I want formatted with a currency ($) symbol. The function that is called is not passing any values, and returning a calculation of the form subtotals per item, and then total sales figure. Can anybody give me any hints on format these cells to a currency value? I can give examples of how my code is currently if required. Thanks in advance I have a javascript-run rotating (as in rotating through a series of content, not rotating in a circle) div. Each content div has an image and a bit of text. The title text - bold arial - is really messy, as though it's a badly pixelated image - smudged, almost. the rest of the text - smaller and not bold - isn't bad, but still doesn't match text outwith these divs. it's fine in firefox, chrome, and even IE6!! Does anyone know what's happening in IE7? I followed the tutorial below and got my image fade to work: http://clagnut.com/sandbox/imagefades/ Now I want to have text become visible once the fade is done. I can't get it to work. style portion: .enhanced { visibility:hidden; } javascript functions: <script language="javascript"> document.write("<style type='text/css'> ##thephoto {visibility:hidden;} </style>"); window.onload = function() {initImage()}; function initImage() { imageId = 'thephoto'; image = document.getElementById(imageId); setOpacity(image, 0); image.style.visibility = 'visible'; fadeIn(imageId,0); } function setOpacity(obj, opacity) { opacity = (opacity == 100)?99.999pacity; // IE/Win obj.style.filter = "alpha(opacity:"+opacity+")"; // Safari<1.2, Konqueror obj.style.KHTMLOpacity = opacity/100; // Older Mozilla and Firefox obj.style.MozOpacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = opacity/100; } function fadeIn(objId,opacity) { if (document.getElementById) { obj = document.getElementById(objId); if (opacity <= 100) { setOpacity(obj, opacity); opacity += 10; window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 150); } if (opacity = 100) { textId = 'enhanced'; text = document.getElementById(textId); text.style.visibility="visible"; } } } </script> I have added this to the last function: if (opacity = 100) { textId = 'enhanced'; text = document.getElementById(textId); text.style.visibility="visible"; } But the text appears instantly. Hello, I am fairly new to javascript so patience is appreciated. I have some javascript I need to execute that is located in an SSI footer. The purpose of the code is to find out what domain the page was loaded at and then to tailor some links to match. Because of how the hosting environment is set up (which I have no control over) when the links don't match the domain they aren't included. I also have to use a complete url (as opposed to relative url) because the footer is included in many different web pages. The problem is that the code is executed but it also is displayed as plain text in firefox. The test site is http://test.ci.edina.mn.us Help! The code is: Code: <script type="text/javascript"> var domainName, strOut; domainName = document.domain; strOut = '<link rel="stylesheet" type="text/css" href="http://' + domainName + '/js/jquery.fancybox/jquery.fancybox.css" media="screen" />'; document.write(strOut); strOut = '<script src="http://' + domainName + '/js/jquery-1.3.2.min.js" type="text/javascript"></script>'; document.write(strOut); strOut = '<script src="http://' + domainName + '/js/jquery.fancybox/jquery.fancybox-1.2.1.js" type="text/javascript"></script>'; document.write(strOut); strOut = '<script src="http://' + domainName + '/js/jquery.easing.1.3.js" type="text/javascript"></script>'; document.write(strOut); </script> Can anyone tell me role of () after a function or so and mainly the function of text inside it? for example how is function stuff (a) { } different from function stuff (b) { } or simply from function stuff () { } ? I would like to have a Javascript WYSIWYG text editor for the site mentioned on the bottom of this post. I don't need anything complex, but basic rich text editing. I know a few of them like CKEditor, TinyCME, WMD etc. I would like to hear others' experience in the regard. Thanks. |