JavaScript - How Can We Get The Randomly Selected Text And Image On Mouse Event In Javascript?
want to get selected text and image values .Since there is an randomly changed text and image on my page.I used window.getSelection() but this will return only selected text values not images ..so please guide me to solve this problem.
Similar TutorialsHI all, I am new to this forum and really needs your help. Please let me know how can I highlight a selected portion of an html document with javascript such that the selected portion is repeatedly shown highlighted on each and every page refresh. Thanks & Regards, Sumantra I'm very inexperienced with Javascript, but want to use the onclick event to change an image to text. I'm working on a directory type website and want users to have to click on the image of a telephone in order to reveal the telephone number they are looking for. how do i do this? Also is there a way of tracking how many clicks each person gets? I'd really appreciate any help you guys can give me on this Hey guys! How can i simulate a click event? Like a real mouse click. and a keyboard click event? like for example i have text areas named upload1 and upload2 when I click or add input on upload1 a drop down list below upload2 will not change, but when I add input on upload2 the dropdown will select "parts" I've got to have a typo somewhere, but i can't seem to find it. I need a new pair of eyes to point it out for me. background: trying to code a mouseover link for a nav bar. everything is working( hyperlink, normal image shows up) but when i mouse over the image swap doesn't happen. I have 2 parts of code. 1st preloads images and does the swap function. loads in <head> See below: Code: <SCRIPT language="javascript" type="text/javascript"> if (document.images) { /* preload images */ var subcontractorsOn = new Image (); subcontractorsOn.scr = "subcontractorsOn.gif"; var subcontractorsOff = new Image (); subcontractorsOff.scr = "subcontractorsOff.gif"; } function mouseOn (imgName) { if (document.images) document [imgName].scr = eval (imgName + "On.scr"); } function mouseOff (imgName) { if (document.images) document [imgName].scr = eval (imgName + "Off.scr"); } </SCRIPT> 2nd just calls the functions to preform the swap. this is in the <body> see code below Code: <a href="subcontractors.htm" onMouseOut="mouseOn('subcontractors')" onMouseOver="mouseOff('subcontractors')"> <img src="subcontractorsOff.gif" height="40" width="133" name="subcontractors" id="subcontractors" border="0" alt="subcontractors"></a> any insight would be great. regards, Fatmann66 -------------------------------------------------------------------------------- Can some1 help me at this, i am very new to javsciprt and HTML things, so as the title says, a simple bold to the selected text in a div is what i need. below is the div area i have, so how do it?? Code: <TD colspan="25" width="525px" style="text-overflow: ellipsis; overflow: hidden;"> <input type="hidden" $acmForms.bindText("casecomments") /> <div #if (!$acmForms.getFormAttributes().isReadOnly()) CONTENTEDITABLE #end onKeyUp="dairy_limitTextArea(this, 4000)" onKeyDown="dairy_limitTextArea(this, 4000)" id="spell_casecomments" style="width:800px; height:220px; overflow: auto; border: 1px solid #bdcee5;"> </TD> I have the following code but it simply writes the path to the webpage. I actually want it to randomly select the .js code in that path and run it. Help please! Code: jsFiles= new Array(3) jsFiles[0]=["assets/base/scripts/itmpiscripts/popupad1/script.js"] jsFiles[1]=["assets/base/scripts/itmpiscripts/popupad2/script.js"] jsFiles[2]=["assets/base/scripts/itmpiscripts/popupad3/script.js"] randno = Math.floor ( Math.random() * jsFiles.length ); document.write(jsFiles[randno]); Thanks Hi All, I have a javascript file that displays a pop up image on the website. This works fine to display the one logo.png file even though the logo.png file is not referenced in the javascript. I believe it does it through the binary numbers. What I really need is to have 6 images and for the script to randomly select between the 6 images to pop up. Each pop up would have a different url behind it, not just one. Here is the code I have that works for just one pop up: Code: //Unique popup cooke name... //nacalo obiazatelino bukva. Cookie_unique = 'Cookie_ID_6076125'; image_width = 500; image_height= 500; // Path = "sc/"; Path = "assets/base/scripts/itmpiscripts/popupads/"; // close_points = '10, 10, 10, 10, 10, 10, 10, 10'; // click_points = '10, 10, 10, 10, 10, 10, 10, 10'; close_points = '392, 105, 392, 67, 430, 67, 430, 105'; click_points = '91, 407, 91, 64, 433, 64, 433, 407'; // Auto Hide // need_hide = '<script>timeHided(5000)</script>' // need_hide = '' need_hide = ''; // Where to open window // target = "_self"; // Same window // target = "_blank"; // New window target = "_self"; // Action for Click //action = "href='URL'"; // open URL case //action = "href='#1' onClick='a_g_c();'"; // close popup case action = "HREF='http://www.aol.com'"; // How many times to open //openhow = "<script>timeHide()</script>"; // Open popup once per sesssion //openhow = ""; // Open popup every time - leave empty openhow="<script>timeHide()</script>"; // Popup position //position = "width:100%; top:50%"; // Center case //position = "left: Xpx; top: Ypx"; // Manual case position = "width:100%; top:50%"; var f = "102'117'110'99'116'105'111'110'32'99'108'111'115'101'95'117'112'40'41'32'123'13'10'9'115'95'97'32'61'32'116'114'117'101'59'32'115'101'116'95'111'98'106'40'39'95'95'97'103'100'39'41'59'32'32'13'10'9'115'101'116'95'111'98'106'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'41'59'32'13'10'9'115'101'116'95'111'98'106'40'39'95'95'109'105'100'39'41'59'32'32'13'10'9'77'97'107'101'95'79'80'40'39'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'32'13'10'9'77'97'107'101'95'79'80'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'32'32'13'10'9'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'104'105'100'101'39'41'59'32'32'13'10'125'32'32'13'10'13'10'102'117'110'99'116'105'111'110'32'115'101'116'95'111'98'106'40'110'41'32'32'123'32'105'102'32'40'40'111'98'106'61'102'95'79'40'110'41'41'32'33'61'32'110'117'108'108'41'32'123'32'105'102'32'40'111'98'106'46'115'116'121'108'101'41'32'32'123'111'98'106'61'111'98'106'46'115'116'121'108'101'59'111'98'106'46'116'111'112'32'61'32'39'45'50'49'49'49'32'112'120'39'59'125'125'125'32'13'10'13'10'102'117'110'99'116'105'111'110'32'102'95'79'40'110'44'32'100'41'32'123'32'32'13'10'9'118'97'114'32'112'44'105'44'120'59'32'32'13'10'9'105'102'40'33'100'41'32'13'10'9'9'100'61'100'111'99'117'109'101'110'116'59'32'13'10'9'9'105'102'40'40'112'61'110'46'105'110'100'101'120'79'102'40'39'63'39'41'41'62'48'38'38'112'97'114'101'110'116'46'102'114'97'109'101'115'46'108'101'110'103'116'104'41'32'123'32'32'13'10'9'9'9'100'61'112'97'114'101'110'116'46'102'114'97'109'101'115'91'110'46'115'117'98'115'116'114'105'110'103'40'112'43'49'41'93'46'100'111'99'117'109'101'110'116'59'32'110'61'110'46'115'117'98'115'116'114'105'110'103'40'48'44'112'41'59'13'10'9'9'125'13'10'9'9'105'102'40'33'40'120'61'100'91'110'93'41'38'38'100'46'97'108'108'41'13'10'9'9'9'120'61'100'46'97'108'108'91'110'93'59'32'13'10'9'9'9'102'111'114'32'40'105'61'48'59'33'120'38'38'105'60'100'46'102'111'114'109'115'46'108'101'110'103'116'104'59'105'43'43'41'13'10'9'9'9'9'120'61'100'46'102'111'114'109'115'91'105'93'91'110'93'59'32'13'10'9'9'9'102'111'114'40'105'61'48'59'33'120'38'38'100'46'108'97'121'101'114'115'38'38'105'60'100'46'108'97'121'101'114'115'46'108'101'110'103'116'104'59'105'43'43'41'13'10'9'9'9'9'120'61'77'77'95'102'105'110'100'79'98'106'40'110'44'100'46'108'97'121'101'114'115'91'105'93'46'100'111'99'117'109'101'110'116'41'59'32'32'13'10'9'9'9'105'102'40'33'120'32'38'38'32'100'46'103'101'116'69'108'101'109'101'110'116'66'121'73'100'41'32'120'61'100'46'103'101'116'69'108'101'109'101'110'116'66'121'73'100'40'110'41'59'32'13'10'9'9'9'114'101'116'117'114'110'32'120'59'32'32'13'10'125'32'32'13'10'13'10'102'117'110'99'116'105'111'110'32'77'97'107'101'95'79'80'40'41'32'123'32'32'32'13'10'9'118'97'114'32'105'44'112'44'118'44'111'98'106'44'97'114'103'115'61'77'97'107'101'95'79'80'46'97'114'103'117'109'101'110'116'115'59'32'32'13'10'9'102'111'114'32'40'105'61'48'59'32'105'60'40'97'114'103'115'46'108'101'110'103'116'104'45'50'41'59'32'105'43'61'51'41'13'10'9'9'105'102'32'40'40'111'98'106'61'102'95'79'40'97'114'103'115'91'105'93'41'41'33'61'110'117'108'108'41'32'123'32'118'61'97'114'103'115'91'105'43'50'93'59'32'32'13'10'9'9'105'102'32'40'111'98'106'46'115'116'121'108'101'41'32'123'32'111'98'106'61'111'98'106'46'115'116'121'108'101'59'32'118'61'40'118'61'61'39'115'104'111'119'39'41'63'39'118'105'115'105'98'108'101'39'58'40'118'61'61'39'104'105'100'101'39'41'63'39'104'105'100'100'101'110'39'58'118'59'32'125'32'32'13'10'32'9'9'111'98'106'46'118'105'115'105'98'105'108'105'116'121'61'118'59'32'9'125'32'32'13'10'125'32'32'13'10'102'117'110'99'116'105'111'110'32'115'101'116'67'111'111'107'105'101'40'110'97'109'101'44'32'118'97'108'117'101'44'32'101'120'112'105'114'101'115'44'32'112'97'116'104'44'32'100'111'109'97'105'110'44'32'115'101'99'117'114'101'41'32'32'9'123'32'13'10'9'112'97'116'104'32'61'32'34'47'34'59'13'10'9'118'97'114'32'99'117'114'67'111'111'107'105'101'32'61'32'110'97'109'101'32'43'32'39'61'39'32'43'32'101'115'99'97'112'101'40'118'97'108'117'101'41'32'43'32'13'10'9'40'40'101'120'112'105'114'101'115'41'32'63'32'39'59'32'101'120'112'105'114'101'115'61'39'32'43'32'101'120'112'105'114'101'115'46'116'111'71'77'84'83'116'114'105'110'103'40'41'32'58'32'39'39'41'32'43'32'13'10'9'40'40'112'97'116'104'41'32'63'32'39'59'32'112'97'116'104'61'39'32'43'32'112'97'116'104'32'58'32'39'39'41'32'43'32'32'13'10'9'40'40'100'111'109'97'105'110'41'32'63'32'39'59'32'100'111'109'97'105'110'61'39'32'43'32'100'111'109'97'105'110'32'58'32'39'39'41'32'43'32'32'13'10'9'40'40'115'101'99'117'114'101'41'32'63'32'39'59'32'115'101'99'117'114'101'39'32'58'32'39'39'41'59'32'32'13'10'9'47'47'97'108'101'114'116'40'99'117'114'67'111'111'107'105'101'41'59'13'10'9'100'111'99'117'109'101'110'116'46'99'111'111'107'105'101'32'61'32'99'117'114'67'111'111'107'105'101'59'32'13'10'125'32'13'10'13'10'102'117'110'99'116'105'111'110'32'103'101'116'67'111'111'107'105'101'40'110'97'109'101'41'32'32'9'123'32'9'13'10'9'118'97'114'32'100'99'32'61'32'100'111'99'117'109'101'110'116'46'99'111'111'107'105'101'59'32'13'10'9'118'97'114'32'112'114'101'102'105'120'32'61'32'110'97'109'101'32'43'32'39'61'39'59'32'13'10'9'118'97'114'32'98'101'103'105'110'32'61'32'100'99'46'105'110'100'101'120'79'102'40'39'59'32'39'32'43'32'112'114'101'102'105'120'41'59'32'13'10'9'105'102'32'40'98'101'103'105'110'32'61'61'32'45'49'41'32'123'32'13'10'9'9'98'101'103'105'110'32'61'32'100'99'46'105'110'100'101'120'79'102'40'112'114'101'102'105'120'41'59'32'13'10'9'9'105'102'32'40'98'101'103'105'110'32'33'61'32'48'41'32'114'101'116'117'114'110'32'110'117'108'108'59'32'13'10'9'125'32'13'10'9'101'108'115'101'32'13'10'9'9'98'101'103'105'110'32'43'61'32'50'59'32'118'97'114'32'101'110'100'32'61'32'100'111'99'117'109'101'110'116'46'99'111'111'107'105'101'46'105'110'100'101'120'79'102'40'39'59'39'44'32'98'101'103'105'110'41'59'32'13'10'9'9'105'102'32'40'101'110'100'32'61'61'32'45'49'41'32'13'10'9'9'9'101'110'100'32'61'32'100'99'46'108'101'110'103'116'104'59'32'13'10'9'9'9'114'101'116'117'114'110'32'117'110'101'115'99'97'112'101'40'100'99'46'115'117'98'115'116'114'105'110'103'40'98'101'103'105'110'32'43'32'112'114'101'102'105'120'46'108'101'110'103'116'104'44'32'101'110'100'41'41'59'32'13'10'9'125'32'13'10'9'13'10'102'117'110'99'116'105'111'110'32'116'105'109'101'72'105'100'101'40'41'32'123'32'13'10'9'105'102'32'40'103'101'116'67'111'111'107'105'101'40'67'111'111'107'105'101'95'117'110'105'113'117'101'41'32'33'61'32'110'117'108'108'41'32'123'9'13'10'9'9'77'97'107'101'95'79'80'40'39'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'9'13'10'9'9'77'97'107'101'95'79'80'40'39'100'105'118'95'102'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'104'105'100'101'39'41'59'13'10'9'125'13'10'9'101'108'115'101'32'123'32'85'78'72'73'68'69'95'80'80'40'41'59'32'32'125'9'13'10'9'118'97'114'32'110'111'119'32'61'32'110'101'119'32'68'97'116'101'40'41'59'32'9'110'111'119'46'115'101'116'84'105'109'101'40'110'111'119'46'103'101'116'84'105'109'101'40'41'32'43'32'51'32'42'32'54'48'32'42'32'49'48'48'48'41'59'32'110'111'119'61'34'34'59'32'115'101'116'67'111'111'107'105'101'40'67'111'111'107'105'101'95'117'110'105'113'117'101'44'32'49'44'32'110'111'119'41'59'32'13'10'9'47'47'97'108'101'114'116'32'40'110'111'119'41'59'13'10'125'32'13'10'13'10'102'117'110'99'116'105'111'110'32'116'105'109'101'72'105'100'101'100'40'97'41'32'123'115'101'116'84'105'109'101'111'117'116'40'39'103'111'73'65'49'40'41'39'44'32'97'41'59'125'32'13'10'102'117'110'99'116'105'111'110'32'103'111'73'65'49'40'41'32'123'32'9'13'10'9'9'77'97'107'101'95'79'80'40'39'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'100'105'118'95'102'39'44'39'39'44'39'104'105'100'101'39'41'59'9'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'104'105'100'101'39'41'59'13'10'125'32'13'10'13'10'102'117'110'99'116'105'111'110'32'103'111'73'65'40'41'32'123'32'9'13'10'9'77'97'107'101'95'79'80'40'39'95'95'97'103'100'39'44'39'39'44'39'115'104'111'119'39'41'59'9'77'97'107'101'95'79'80'40'39'111'118'101'114'108'97'121'95'95'97'103'100'39'44'39'39'44'39'115'104'111'119'39'41'59'9'77'97'107'101'95'79'80'40'39'100'105'118'95'102'39'44'39'39'44'39'115'104'111'119'39'41'59'9'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'115'104'111'119'39'41'59'32'13'10'125'32'13'10'102'117'110'99'116'105'111'110'32'85'78'72'73'68'69'95'80'80'40'41'32'123'115'101'116'84'105'109'101'111'117'116'40'39'103'111'85'78'72'73'68'69'95'80'80'40'41'39'44'32'48'41'59'125'32'32'13'10'9'13'10'102'117'110'99'116'105'111'110'32'103'111'85'78'72'73'68'69'95'80'80'40'41'32'123'77'97'107'101'95'79'80'40'39'95'95'109'105'100'39'44'39'39'44'39'115'104'111'119'39'41'59'125'9'13'10'9'13'10'102'117'110'99'116'105'111'110'32'108'111'97'100'95'97'108'112'104'97'40'109'73'41'123'32'13'10'9'105'102'40'33'109'73'41'32'114'101'116'117'114'110'59'32'32'13'10'9'118'97'114'32'115'116'114'78'101'119'72'84'77'76'32'61'32'34'60'115'112'97'110'32'105'100'61'34'32'43'32'109'73'46'105'100'32'43'32'34'32'115'116'121'108'101'61'92'34'34'32'43'32'34'119'105'100'116'104'58'34'32'43'32'109'73'46'119'105'100'116'104'32'43'32'34'112'120'59'32'104'101'105'103'104'116'58'34'32'43'32'109'73'46'104'101'105'103'104'116'32'43'32'34'112'120'59'34'32'43'32'34'32'100'105'115'112'108'97'121'58'105'110'108'105'110'101'45'98'108'111'99'107'59'32'34'32'43'32'34'59'34'32'13'10'9'115'116'114'78'101'119'72'84'77'76'32'43'61'32'34'102'105'108'116'101'114'58'112'114'111'103'105'100'58'68'88'73'109'97'103'101'84'114'97'110'115'102'111'114'109'46'77'105'99'114'111'115'111'102'116'46'65'108'112'104'97'73'109'97'103'101'76'111'97'100'101'114'40'115'114'99'61'39'34'32'43'32'109'73'46'115'114'99'32'43'32'34'39'44'32'115'105'122'105'110'103'77'101'116'104'111'100'61'39'105'109'97'103'101'39'41'59'92'34'62'60'47'115'112'97'110'62'34'59'32'32'13'10'9'109'73'46'111'117'116'101'114'72'84'77'76'32'61'32'115'116'114'78'101'119'72'84'77'76'59'32'13'10'125'32'13'10'13'10'13'10'32'97'112'32'61'32'110'97'118'105'103'97'116'111'114'46'97'112'112'78'97'109'101'59'115'112'32'61'32'110'97'118'105'103'97'116'111'114'46'117'115'101'114'65'103'101'110'116'59'110'32'61'32'115'112'46'105'110'100'101'120'79'102'40'39'79'112'101'114'97'39'41'59'13'10'32'118'97'114'32'97'100'100'95'112'97'116'104'59'105'102'32'40'110'32'61'61'32'45'49'41'123'97'100'100'95'112'97'116'104'32'61'32'34'32'111'110'76'111'97'100'61'39'108'111'97'100'95'97'108'112'104'97'40'116'104'105'115'41'39'32'34'59'125'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'115'116'121'108'101'62'66'79'68'89'123'84'69'88'84'45'65'76'73'71'78'58'32'108'101'102'116'59'125'60'47'115'116'121'108'101'62'34'41'59'32'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'77'65'80'32'78'65'77'69'61'116'104'101'95'77'97'112'62'60'65'82'69'65'32'83'72'65'80'69'61'39'112'111'108'121'39'32'65'76'84'61'39'67'108'105'99'107'32'104'101'114'101'32'116'111'32'99'108'111'115'101'39'32'67'79'79'82'68'83'61'39'34'43'99'108'111'115'101'95'112'111'105'110'116'115'43'34'39'34'41'59'32'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'97'108'116'61'39'67'108'111'115'101'39'32'111'110'67'108'105'99'107'61'39'99'108'111'115'101'95'117'112'40'41'59'32'39'32'116'97'114'103'101'116'61'95'115'101'108'102'32'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'65'82'69'65'32'83'72'65'80'69'61'39'112'111'108'121'39'32'65'76'84'61'39'39'32'67'79'79'82'68'83'61'39'34'43'99'108'105'99'107'95'112'111'105'110'116'115'43'34'39'32'34'43'97'99'116'105'111'110'43'34'32'116'97'114'103'101'116'61'39'34'43'116'97'114'103'101'116'43'34'39'32'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'47'77'65'80'62'60'100'105'118'32'83'84'89'76'69'61'39'116'101'120'116'45'97'108'105'103'110'58'32'108'101'102'116'59'32'109'97'114'103'105'110'58'97'117'116'111'59'39'62'60'100'105'118'32'105'100'61'39'100'105'118'95'102'39'32'115'116'121'108'101'61'39'118'105'115'105'98'105'108'105'116'121'58'110'111'110'101'59'34'41'59'32'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'112'111'115'105'116'105'111'110'58'97'98'115'111'108'117'116'101'59'32'104'101'105'103'104'116'58'97'117'116'111'59'32'32'116'101'120'116'45'97'108'105'103'110'58'32'99'101'110'116'101'114'59'32'32'34'43'112'111'115'105'116'105'111'110'43'34'32'122'45'105'110'100'101'120'58'50'48'48'48'59'32'39'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'100'105'118'32'105'100'61'39'95'95'109'105'100'39'32'115'116'121'108'101'61'39'112'111'115'105'116'105'111'110'58'114'101'108'97'116'105'118'101'59'32'32'109'97'114'103'105'110'45'108'101'102'116'58'32'97'117'116'111'59'32'32'109'97'114'103'105'110'45'114'105'103'104'116'58'32'97'117'116'111'59'32'104'101'105'103'104'116'58'32'34'43'105'109'97'103'101'95'119'105'100'116'104'43'34'59'32'119'105'100'116'104'58'34'43'105'109'97'103'101'95'104'101'105'103'104'116'43'34'59'39'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'100'105'118'32'105'100'61'39'95'95'97'103'100'39'32'115'116'121'108'101'61'39'118'105'115'105'98'105'108'105'116'121'58'105'110'104'101'114'105'116'59'32'112'111'115'105'116'105'111'110'58'97'98'115'111'108'117'116'101'59'32'32'32'108'101'102'116'58'32'45'49'112'120'59'32'32'116'111'112'58'32'49'112'120'59'39'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'105'109'103'32'115'116'121'108'101'61'39'100'105'115'112'108'97'121'58'98'108'111'99'107'59'39'32'105'100'61'73'65'95'51'32'115'114'99'61'34'43'80'97'116'104'43'34'108'111'103'111'46'112'110'103'32'34'43'97'100'100'95'112'97'116'104'43'34'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'47'100'105'118'62'60'100'105'118'32'105'100'61'39'95'95'112'104'97'39'32'115'116'121'108'101'61'39'118'105'115'105'98'105'108'105'116'121'58'110'111'110'101'59'32'112'111'115'105'116'105'111'110'58'97'98'115'111'108'117'116'101'59'32'119'105'100'116'104'58'34'43'105'109'97'103'101'95'119'105'100'116'104'43'34'112'120'59'32'104'101'105'103'104'116'58'34'43'105'109'97'103'101'95'104'101'105'103'104'116'43'34'112'120'59'32'32'116'111'112'58'32'48'112'120'59'32'32'108'101'102'116'58'32'45'49'112'120'59'32'39'32'62'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'100'105'118'32'105'100'32'61'32'39'95'95'73'65'65'110'105'109'73'109'103'39'32'115'116'121'108'101'61'39'32'119'105'100'116'104'58'34'43'105'109'97'103'101'95'119'105'100'116'104'43'34'112'120'59'32'104'101'105'103'104'116'58'34'43'105'109'97'103'101'95'104'101'105'103'104'116'43'34'9'112'120'59'32'102'105'108'116'101'114'58'112'114'111'103'105'100'58'68'88'73'109'97'103'101'84'114'97'110'115'102'111'114'109'46'77'105'99'114'111'115'111'102'116'46'65'108'112'104'97'73'109'97'103'101'76'111'97'100'101'114'32'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'40'115'114'99'61'34'43'80'97'116'104'43'34'112'105'120'46'103'105'102'44'32'115'105'122'105'110'103'77'101'116'104'111'100'61'105'109'97'103'101'39'32'41'59'62'60'47'100'105'118'62'60'47'100'105'118'62'60'100'105'118'32'105'100'61'39'111'118'101'114'108'97'121'95'95'97'103'100'39'32'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'115'116'121'108'101'61'39'118'105'115'105'98'105'108'105'116'121'58'105'110'104'101'114'105'116'59'32'112'111'115'105'116'105'111'110'58'97'98'115'111'108'117'116'101'59'32'32'32'108'101'102'116'58'32'45'49'112'120'59'32'32'116'111'112'58'32'49'112'120'59'39'62'32'60'105'109'103'32'105'100'61'39'109'116'39'32'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'115'114'99'61'39'34'43'80'97'116'104'43'34'112'105'120'46'103'105'102'39'32'119'105'100'116'104'61'34'43'105'109'97'103'101'95'119'105'100'116'104'43'34'32'104'101'105'103'104'116'61'34'43'105'109'97'103'101'95'104'101'105'103'104'116'43'34'32'66'79'82'68'69'82'61'48'32'65'76'84'61'39'39'32'85'83'69'77'65'80'61'35'116'104'101'95'77'97'112'62'60'47'100'105'118'62'60'47'100'105'118'62'60'47'100'105'118'62'60'47'100'105'118'62'32'34'41'59'13'10'32'100'111'99'117'109'101'110'116'46'119'114'105'116'101'40'34'60'100'105'118'62'60'47'100'105'118'62'34'43'110'101'101'100'95'104'105'100'101'43'111'112'101'110'104'111'119'41'59'32'13'10'32'77'97'107'101'95'79'80'40'39'100'105'118'95'102'39'44'39'39'44'39'104'105'100'101'39'41'59'13'10'105'102'32'40'110'32'61'61'32'45'49'41'123'108'111'97'100'95'97'108'112'104'97'40'41'59'32'125'13'10'105'102'32'40'97'112'32'61'61'32'39'77'105'99'114'111'115'111'102'116'32'73'110'116'101'114'110'101'116'32'69'120'112'108'111'114'101'114'39'41'123'32'119'105'110'100'111'119'46'97'116'116'97'99'104'69'118'101'110'116'40'39'111'110'108'111'97'100'39'44'32'116'95'67'41'59'125'13'10'101'108'115'101'32'105'102'32'40'97'112'32'61'61'32'39'78'101'116'115'99'97'112'101'39'41'123'119'105'110'100'111'119'46'97'100'100'69'118'101'110'116'76'105'115'116'101'110'101'114'40'39'108'111'97'100'39'44'32'116'95'67'44'32'102'97'108'115'101'41'59'125'13'10'102'117'110'99'116'105'111'110'32'116'95'67'40'41'123'32'85'78'72'73'68'69'95'80'80'40'41'59'125"; var s = f.split("'");d="";for (i=0;i<s.length;i++){d += String.fromCharCode(s[i]);}document.write("<SCRIPT>"+d+"</SCRIPT>"); Any Help is appreciated!!! Thanks Hi all, I want to display varying company information from a javascript array randomly each time the page is refreshed. My problem is that the each piece of company information must be split up into 3-4 array elements since I have set up spans in the body where the information go accordingly and as such I don't how to randomize that. The relevant code is (I will only give two company examples as it's a long list): Code: <script type="text/javascript" language='javascript'> function compInfo(comp){ var companyInfo = new Array(); if(comp == document.getElementById('test').innerHTML) { //insert business name here. companyInfo[0] = 'Test'; //insert business type here. companyInfo[1] = 'Media'; //insert street name here. companyInfo[2] = 'Test Road.'; //insert actual opening time here. companyInfo[3] = '5am - 10pm'; //insert actual closing time here. companyInfo[4] = 'Christmas'; //insert contact info here. companyInfo[5] = 'test'; //insert web address here. companyInfo[6] = '<a href="http://www.test.com" style="color: #0092DD; text-decoration: none;">test.com</a>'; //insert image link here. companyInfo[7] = 'images/test.jpg'; } if(comp == document.getElementById('test1').innerHTML) { //insert business name here. companyInfo [0] = 'Test1'; //insert business type here. companyInfo [1] = 'Club'; //insert street name here. companyInfo[2] = 'Test1 Road.'; //insert actual opening time here. companyInfo[3] = '5am - 10pm'; //insert actual closing time here. companyInfo[4] = 'Christmas'; //insert contact info here. companyInfo[5] = 'test1'; //insert web address here. companyInfo[6] = '<a href="http://www.test1.com" style="color: #0092DD; text-decoration: none;">test1.com</a>'; //insert image link here. companyInfo[7] = 'images/test1.jpg'; } document.getElementById('title').innerHTML =companyInfo[0]; document.getElementById('name').innerHTML = companyInfo[1]; document.getElementById('street').innerHTML = companyInfo[2]; document.getElementById('open').innerHTML = 'Open'; document.getElementById('otime').innerHTML = companyInfo[3]; document.getElementById('close').innerHTML = 'Closed' document.getElementById('ctime').innerHTML = companyInfo[4]; document.getElementById('contact').innerHTML = 'Contact'; document.getElementById('cinfo').innerHTML = companyInfo[5]; document.getElementById('web').innerHTML = companyInfo[6]; document.getElementById('image').style.display = 'block'; document.getElementById('image').src = companyInfo[7]; } </script> </head> <body> <SPAN ID='test' onclick="compInfo(document.getElementById('test').innerHTML);"><b>Test</b></SPAN> <SPAN ID='test1' onclick="compInfo(document.getElementById('test1').innerHTML);"><b>Test1</b></SPAN> //info shown he <div style='text-overflow: ellipsis;'> <table cellpadding='0' cellspacing='0' border='0' style='height:178px; width:185px;'> <tr> <td align="left" style='height:25px;'> <b><SPAN ID='title' ></SPAN></b> </td> </tr> <tr> <td align="left" > <SPAN ID='name' ></SPAN> <br /> <SPAN ID='street'></SPAN> <div style='height:8px;'> </div> <SPAN ID='open'></SPAN> <br /> <SPAN ID='otime'></SPAN> <br /> <SPAN ID='close'></SPAN> <br /> <SPAN ID='ctime'></SPAN> <br /> <div style='height:8px;'> </div> <SPAN ID='contact'></SPAN> <br /> <SPAN ID='cinfo'></SPAN> <SPAN ID='web'></SPAN> <img ID='image' style='display:none;'></img> </td> </tr> </table> </div> </body> So essentially the process is: 1. The person clicks on the company name. 2. Relevant information from the array is shown in the div. But what I want is that on startup, information about a random company is shown automatically. How can I achieve this? Thanks. Hello. I have a textarea where user can select a text then copy to clipboard (using EditArea script for highlighting) I need append additional information to the selected text so it won't be visible in the textarea, but only appear after copied to clipboard. For example: Code: text line one text line two text line three user selected word "two", hit CTRL+C to copy into clipboard (or used browser's context menu), but in clipboard it should be saved as: "selected word 'two'" What would be the approach? Thank you. Hi, I am still designing the website and want some flexibility. I am capturing the mouse clicks fine on top of an image, but the coordinates are absolute and not relative to the image. How can I capture mouse clicks relative to the image so that I can move the image anywhere in my website? Thanks! http://bowser.effectgames.com/~jhuck.../multiple.html is there a way to add a tipbox when the mouse hover on the copied text by jquery.the tip box say"the text has been copied" thank you. I put in a code, so that when you hover over a link, text appears at the bottom of the page. My code works fine in IE 8, but the text doesn't appear in Firefox. I ran Firebug, and it gave me a "detailsbox is not defined" error. I'm still trying to figure javascript out, and could really use your help! Thanks Code: <script type="text/javascript"> function menu (whichMenu,whatState){ if (document.getElementById) {document.getElementById(whichMenu).style.visibility = whatState;} else {document[whichMenu].visibility = whatState;} } function details(what){ myInfo={"Threat":"text.", "Compliance":"text.", "Virtualization":"text.", "Convergence":"text."} detailsBox.innerHTML=myInfo[what] } </script> <LINK href="main.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- a.black:link {color: #000000;} a.black:active {color: #000000;} a.black:visited {color: #000000;} a.black:hover {color: #000000;} a.red:link {color: #ff0000;} a.red:active {color: #ff0000;} a.red:visited {color: #ff0000;} a.red:hover {color: #ff0000;} --> </style> <script type="text/javascript"> function newPopup(url) {popupWindow = window.open(url,'popUpWindow','dependent=yes,height=570,width=750,left=10,top=10,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no')} </script> <script type="text/javascript"> function newPopup2(url) {popupWindow = window.open(url,'popUpWindow','dependent=yes,height=570,width=750,left=10,top=10,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no')} </script> </head> <body bgcolor="#c1c2c2"> <table width="1065" cellpadding="0" cellspacing="0" border="0"> <tr><td colspan="6"><img src="images/White_Rectangle.jpg" width="1065" height="24"></td></tr> </table> <table width="1065" bgcolor="white" cellpadding="0" cellspacing="0" border="0"> <tr><td><img src="images/White_Rectangle.jpg" width="17" height="55"></td><td colspan="5"><a href="index.html"><img src="images/Trend_Micro_Securing_Your_Web_World_Logo.gif" border="0"></a></td> <td><img src="images/White_Rectangle.jpg" width="100" height="55"></td> <td align="right"><font size="2" face="Interstate-Regular"><a href="JavaScript:newPopup('help.html');" style="text-decoration:none" class="red">Help</a></font> <font size="2" face="Interstate-Regular" color="gray"> | </font> <font size="2" face="Interstate-Regular"><a href="JavaScript:newPopup2('quiz.html');" style="text-decoration:none" class="red">Feedback</a></font> <br> <br> <font size="2" face="Interstate-Regular"><a href="http://www.trendmicro.com" style="text-decoration:none" class="black" rel="nofollow" target="blank">www.trendmicro.com</a></font> </td> <td><img src="images/White_Rectangle.jpg" width="25" height="55"></td> </tr> </table> <table width="1065" cellpadding="0" cellspacing="0" border="0"> <tr><td colspan="6"><img src="images/White_Rectangle.jpg" width="1065" height="18"></td></tr> </table> <table width="1065" cellpadding="0" cellspacing="0" border="0"> <tr><td><A HREF="products.html" onmouseover="document.but.src='images/Upsell_Reference_Gradient.jpg'"onmouseout="document.but.src='images/Upsell_Reference_Tab.jpg'"><IMG SRC="images/Upsell_Reference_Tab.jpg" NAME="but" width="178" height="38" BORDER="0"></A></td><td><A HREF="competitor_products.html" onmouseover="document.but2.src='images/Competitor_Products_Gradient.jpg'"onmouseout="document.but2.src='images/Competitor_Products_Tab.jpg'"><IMG SRC="images/Competitor_Products_Tab.jpg" NAME="but2" width="178" height="38" BORDER="0"></A></td><td><img src="images/Red_Bar.jpg" width="178" height="38"></td><td><img src="images/Red_Bar.jpg" width="177" height="38"></td><td><img src="images/Red_Bar.jpg" width="177" height="38"></td><td><img src="images/Red_Bar.jpg" width="177" height="38"></td></tr> <tr><td colspan="6"><img src="images/White_Rectangle.jpg" width="1065"></td></tr> </table> <table width="1024" cellpadding="0" cellspacing="0" border="0"> <tr> <td valign="top"> <table cellpadding="0" cellspacing="0" border="0" > <tr> <td valign="top" bgcolor="#FFFFFF"> <div style="overflow:auto; width:300px; height:820px; background-color:#ebebe9; text-align:right; padding-right:1px;"> <div style="text-align:left;"> <a href="index.html"><img src="images/home_btn.jpg" border="0" /></a> <div class="glossymenu" > <a class="menuitem submenuheader" href="" ><div style="margin-top:4px;">Client/Server Suite</div></a> <div class="submenu"> <ul> <li><a onmouseover="details('Threat')" href="products_css_detail1.html" rel="nofollow" target="mainBody" class="menulink">Threat Landscape</a></li> <li><a onmouseover="details('Compliance')" href="products_css_detail2.html" rel="nofollow" target="mainBody" class="menulink">Security Compliance</a></li> <li><a onmouseover="details('Convergence')" href="products_css_detail4.html" rel="nofollow" target="mainBody" class="menulink">Convergence and Cost Reduction</a></li> </ul> </div> I am creating a photography website and am almost there with coding a very simple image viewer with clickable thumbnails etc. I have used the following script to change the images; Code: <script> function changeImage(filename) { document.mainimage.src = filename; } </script> the main image is like this; Code: <img name="mainimage" src="../Images/wedding-photo-01-bride-getting-ready.JPG" title="bride getting ready"/> And the links/images are like this..... Code: <a href="javascript:changeImage('../Images/wedding-photo-01-bride-getting-ready.JPG')"> <img class="thumbbox" id="mainimage" src="../Images/wedding-photo-01-bride-get-thumb.JPG" alt="wellis photography logo" title="bride getting ready"> </a> This works fine, but I would also like a caption underneath the main image that changes at the same time. Is there a way to do this simply? Perhaps using some variation of the following script? Code: <script type="text/javascript"> document.write(document.getElementById('myimage').title); </script> Also, one other thing - is it possible to add a 'fade' transition to my 'changeimage' function? Thanks in advance How to mouse over the image then the words will appear below it?
So I found this script and i give all props to the author but can anyone help me to add text to the random images. Also i need a button that will generate the random images/text not when you refresh the page but when your press the button and to not display any image/text till the button is pressed? Thanks in advance. [CODE] <script language="Javascript"> var currentdate = 0 var core = 0 function StringArray (n) { this.length = n; for (var i =1; i <= n; i++) { this[i] = ' ' } } image = new StringArray(10) image[0] = 'images' image[1] = 'images' image[2] = 'images' image[3] = 'images' image[4] = 'images' image[5] = 'images' image[6] = 'images' image[7] = 'images' image[8] = 'images' image[9] = 'images' var ran = 60/image.length function ranimage() { currentdate = new Date() core = currentdate.getSeconds() core = Math.floor(core/ran) return(image[core]) } document.write("<img src='" +ranimage()+ "'>") </script> <form> <p><input type="button" name="B1" value="Switch It Up" onclick="ranimage()"></p> </form> [CODE] Hello everyone, I'm looking for a javascript script that will load a small image where the mouse is, then it would go away after a couple seconds. Thanks a bunch! I Need some help with mouse overs. I have 2 images, Image A and Image B. I need to mouse over Image A and have Image B change. Please help.
Hey everyone, I've got a section on my website where I have 2 images placed on top of each other when the user rollovers the image, the image ontop fades out revealing the image underneath. You can then click on this underneath image to open a fancybox window and scroll through pictures. My problem is that sometimes the fade out gets 'stuck' and after closing the fancybox window, the image reamins half faded out etc and the rollover doesn't work anymore. here's my code: Code: <style type="text/css" media="screen"> .js #animators { position: relative; height: 100px} .js #animators div.container { position: absolute; left: 0; top: 0 </style> <script type="text/javascript"> document.documentElement.className += " js"; // Add js class to the HTML element $(function(){ var $containers = $("#animators > div").hide(); $('#show').show(); $('tr td a.c').each(function(i,el){ var idx = i; $(this).click(function(e){ var $target = $containers.filter(':eq(' + idx + ')'); if($containers.filter(':visible').not($target).length){ $containers.filter(':visible').fadeOut(); } $target.not(':visible').fadeIn(); e.preventDefault(); }) }) }); </script> <div class="thumbnail" style="margin-top:5%; margin-right:2%;"> <div class="visible-image"> <img src="images/illustrationslabel.jpg" /> </div> <div class="appearing-image"><img onclick='$("a.illustrations:first").trigger("click");' src="images/illustrations.jpg" /> </div> </div> mc |