JavaScript - How Can I Adjust This Javscript To Encompass Multiple Users
I had a thread on here earlier in which one of you helped me immensely. As I mentioned in that thread, I know very little about javascript. The code I was given basically handles one user, and does it very well. I have since attended a meeting in which I was asked to have multiple users on one page. For example:
My current code handles the following: Name - Hours - series of radio button choices. My updated request is the following: Name - Hours - series of radio button choices Name - Hours - series of radio button choices Name - Hours - series of radio button choices Name - Hours - series of radio button choices etc. up to 15 total users. I have tried to adjust the javascript, but with my lack of knowledge in this area I keep breaking it. Any help would again be greatly appreciated, here is my code: Code: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Jared Daily Sales Goal Calculation Worksheet</title> </head> <script type="text/javascript"> var IE = navigator.appName == "Microsoft Internet Explorer"; var nSets = ""; var answeredQ = []; function advanceTo(nextQ,nQ){ var currAns = answeredQ[nQ.name.replace(/q/,"")-1]; if (currAns != "-" && currAns != nQ.value) { var nFloor = nQ.parentNode.parentNode.id.replace(/f/,"")-1; for (i=0; i<nSets.length; i++) { if (i > nFloor) { nSets[i].style.display = "none"; } } } nSets[nextQ-1].style.display = ""; answeredQ[nQ.name.replace(/q/,"")-1] = nQ.value; } function init(){ nSets = document.forms[0].getElementsByTagName('fieldset'); for (i=1; i<nSets.length; i++) { nSets[i].style.display = "none"; answeredQ[answeredQ.length] = "-"; } } IE ? attachEvent('onload', init, false) : addEventListener('load', init, false); </script> <style type="text/css"> body {background-color: #ffffff; margin-top: 60px;} fieldset {border: 0px} td { font-family:Arial, Helvetica, sans-serif; font-size:12px;} h1 { font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold;} </style> <body> <cfform action="" method="post"> <!--- Header ---> <table border="1"> <tr> <td> <table align="left"> <tr bgcolor="#E5E5E5"> <td>Name</td> <td>Hours</td> <td colspan="4"></td> </tr> <!--- Emp 1 ---> <tr bgcolor="#ffffff"> <td valign="top"><input name="" size="10"></td> <td valign="top"><input name="" size="10"></td> <td valign="top"> <fieldset id="f1"> <!-- Question 1 --> <label><input type="radio" name="e1q1" value="Diamond1" onclick="advanceTo(2,this)">Diamond</label> <label><input type="radio" name="e1q1" value="Perimeter1" onclick="advanceTo(3,this)">Perimeter</label> </fieldset> </td> <td valign="top"> <fieldset id="f2"> <!-- Question 2 --> |<label><input type="radio" name="e1q2" value="GM1">GM</label> <label><input type="radio" name="e1q2" value="AGM1">AGM</label> <label><input type="radio" name="e1q2" value="DDM1">DDM</label> <label><input type="radio" name="e1q2" value="FT1" onclick="advanceTo(4,this)">Full Time</label> <label><input type="radio" name="e1q2" value="PT1" onclick="advanceTo(4,this)">Part Time</label> </fieldset> </td> <td valign="top"> <fieldset id="f3"> <!-- Question 3 --> <label><input type="radio" name="e1q3" value="PDM">PDM</label> <label><input type="radio" name="e1q3" value="RL">RL</label> <label><input type="radio" name="e1q3" value="FT1" onclick="advanceTo(4,this)">Full Time</label> <label><input type="radio" name="e1q3" value="PT1" onclick="advanceTo(4,this)">Part Time</label> </fieldset> </td> <td valign="top"> <fieldset id="f4"> <!-- Question 4 --> |<label><input type="radio" name="e1q4" value="Tenured1">Tenured</label> <label><input type="radio" name="e1q4" value="NonTenured1">Under 2 Years</label> </fieldset> </td> </tr> </table> </td></tr></table> </cfform> </body> </html> Similar TutorialsHi, I am using a multiple select with javascript to update the navigation bar <li> depending on which single option is selected and it's working well. The only problem however, is when multiple are selected, I want all a class to be added to all the <li> but it's not working. if (document.getElementById("status_advanced").value == "1"){ $('.moduleTitle').html("<h2>Enquiries</h2><span class='utils'> <a id='create_image' href='index.php?module=AOS_Invoices&action=EditView&return_module=AOS_Invoices&return_ac tion=DetailView' class='utilsLink'><img src='custom/themes/default/images/create-record.gif?v=9FuiS_EWfdVgVhHTU4vK3g' alt='Create'></a><a id='create_link' href='index.php?module=AOS_Invoices&action=EditView&return_module=AOS_Invoices&return_ac tion=DetailView' class='utilsLink'>Create</a></span>"); $("#enquiries-nav").addClass("currentTab"); $("#jobs-nav").removeClass("currentTab"); } else if (document.getElementById("status_advanced").value == "2"){ $('.moduleTitle').html("<h2>Jobs</h2>"); $("#jobs-nav").addClass("currentTab"); $("#enquiries-nav").removeClass("currentTab"); } else if (document.getElementById("status_advanced").value == "3"){ $('.moduleTitle').html("<h2>Clearance</h2>"); $("#clearance-nav").addClass("currentTab"); $("#jos-nav").removeClass("currentTab"); } else if ((document.getElementById("status_advanced").value == "1") && (document.getElementById("status_advanced").value == "2")){ $('.moduleTitle').html("<h2>All</h2>"); $("#enquiries-nav").addClass("currentTab"); $("#jos-nav").addClass("currentTab"); } Any suggestions? Reply With Quote 01-20-2015, 01:56 PM #2 Philip M View Profile View Forum Posts Supreme Master coder! Join Date Jun 2002 Location London, England Posts 18,371 Thanks 204 Thanked 2,573 Times in 2,551 Posts Suggest you have a select option "All". Use this example:- Code: <!DOCTYPE html> <html> <head> </head> <body> <form id="InventoryList" method="post" action=""> <select id="SelBranch" class="class1" size="5" multiple="multiple"> <option value="All Branches">All Branches</option> <option value="001 London">001 London</option> <option value="002 Birmingham">002 Birmingham</option> <option value="003 Manchester">003 Manchester</option> <option value="004 Nottingham">004 Nottingham</option> <option value="005 Bradford">005 Bradford</option> <option value="006 Newcastle">006 Newcastle</option> </select> <input type="button" id ="ViewReport" value="View" class="class1" onclick="GetInventory();"> </form> <script type = "text/javascript"> function GetInventory() { var sel = document.getElementById("SelBranch"); var count = 0; var SelBranchVal = []; for (x=0; x<sel.length; x++) { if (sel[x].selected) { SelBranchVal[count] = sel[x].value; count++; } } alert(SelBranchVal); } </script> </body> </html> Quizmaster: Which word for a spring or town with thermal or mineral waters used for drinking or bathing takes its name from a town in Belgium which is famed for its supposedly curative waters? Contestant: Volvic Hey, I need help big time as my site has just completly buggered up lol! I just made a JS script which laoads data into a div (ajax style) which means page refreshes are not required... but currently it loads a $pagename.php "contents" in to the div - but i cannot have this method. What i need it to do - is generate a string with the $pagename.php and inject that to a variable into the div... heres what i got: This works as its meant to - but needs to be changed to suit my new method: Code: var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no) var loadedobjects="" var rootdomain="http://"+window.location.hostname var bustcacheparameter="" function ajaxpage(url, containerid){ var page_request = false if (window.XMLHttpRequest) // if Mozilla, Safari etc page_request = new XMLHttpRequest() else if (window.ActiveXObject){ // if IE try { page_request = new ActiveXObject("Msxml2.XMLHTTP") } catch (e){ try{ page_request = new ActiveXObject("Microsoft.XMLHTTP") } catch (e){} } } else return false page_request.onreadystatechange=function(){ loadpage(page_request, containerid) } if (bustcachevar) //if bust caching of external page bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime() page_request.open('GET', url+bustcacheparameter, true) page_request.send(null) } function loadpage(page_request, containerid){ if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) document.getElementById(containerid).innerHTML=page_request.responseText } function loadobjs(){ if (!document.getElementById) return for (i=0; i<arguments.length; i++){ var file=arguments[i] var fileref="" if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding if (file.indexOf(".js")!=-1){ //If object is a js file fileref=document.createElement('script') fileref.setAttribute("type","text/javascript"); fileref.setAttribute("src", file); } else if (file.indexOf(".css")!=-1){ //If object is a css file fileref=document.createElement("link") fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", file); } } if (fileref!=""){ document.getElementsByTagName("head").item(0).appendChild(fileref) loadedobjects+=file+" " //Remember this object as being already added to page } } } With that and this below is how it all works on the site so far: Code: <a href="javascript:ajaxpage(login.php','contentarea');">Link to login</a> <div id="contentarea"></div> How ever i need to change this so instead of it just "loading the page contents" into the div i want the JS to do similiar idea of loading into the div but merely pass php into it so i can do this: Code: <a href="javascript:ajaxpage(login.php','contentarea');">Link to login</a> <div id="contentarea"> <?php include($name); //$name being "login.php" due to above href //$name value needs to be made from the JS from getting the //url in the HREF whilst not refreshing the page to do so. ?> </div> Can some one help me edit my JS to do what im trying to do ? I'm stuck at this point at trying to get it to do this final part. Greetings..... I am not quite sure where to place this question since it involves C#, javascript and even a call to SSRS. What I want to do is call a Sql Server Reporting Services Report, using javascript like so: Code: ClientScript.RegisterStartupScript(GetType(), "FrameUpdate", "<script language=\"JavaScript\">" + "\n" + "cursor_wait();" + "\n" + "window.location.href ='http://serverName/ReportServer?/myReport/my Information Report&rc:Parameters=false&ANumber=" + ViewState["ANumber"].ToString().Trim() + "&BNumber=" + ViewState["BNumber"].ToString() + "&Sort_Param=" + ViewState["sortField"].ToString() + "&Sort_Direction=" + ViewState["sortDirection"].ToString() +"&rc:Toolbar=false&rs:Command=render&rs:Format=PDF&rs:Zoom=Fit Page'; " + "\n" + "cursor_clear();" + "\n" + "<" + "/script>"); The code works and I can pull the correct report. The issue is I wanted some visual que for the user that the report was being gernerated. that is why i used the javascript functions : cursor_wait(), and cursor_clear(). The problem is I want to display a wait cursor untill the window with the report returns and displays the report then reset to the default cursor at that time. But the above code resets the cursor right away without waiting for the report to return. I tried adding attributes to the page form and other methods to access onBlur and such but haven't been able to get there yet. A very tricky problem. I don't think it's calling teh function: setzoomimage when i click on Magnify Code: <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="flash/swfobject.js"></script> <script> // store the contents of the main image when zoomified used var mainimagesafe = ""; //swaps the main product images //on __incMain.asp function removezoom() { if(mainimagesafe != "") { var d = document.getElementById('mainimagecontainer'); var olddiv = document.getElementById('flashZoomer'); d.removeChild(olddiv); document.getElementById('mainimagecontainer').innerHTML = mainimagesafe; mainimagesafe = ""; } } function setzoomimage(){ if( mainimagesafe != "") { removezoom(); } else { swapcolour("altview5"); mainimagesafe = document.getElementById("mainimagecontainer").innerHTML; var so = new SWFObject("flash/flashZoomer_blackDiamond310_500.swf", "flashZoomer", 310, 500, "8", "#EFEBE2"); so.addParam("quality", "high"); so.addParam("scale", "noscale"); so.addParam("salign", "tl"); so.addVariable("imgSrc", "images/BigFlower03_002Main.png"); so.addVariable("zoomSteps", "5"); so.addVariable("startState", "select"); so.write("mainimagecontainer"); } } </script> </head> <body> <table> <tr> <td style="width:310px; vertical-align:top;"> <div id="mainviewimage"> <div id="mainimagecontainer"><img id="mainimage" src="images/BigFlower03_003Zoom.png" height="520" width="310" alt="" /></div> <span id="altview5" style="cursor:pointer;display:inline;float:right;" onclick="setzoomimage();">CLICK TO MAGNIFY <img style="vertical-align:bottom;" src="images/magnify.png" alt="" /></span> <span id="altview" style="cursor:pointer;" onclick="javascript:swapcolour('altview');swapMainImage('images/BigFlower03_003Zoom.png');"> 1</span> </div> </td> </tr> </table> </body> </html> I have this php validation string
Code: $urlregex = "^(https?|ftp)\:\/\/([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*(\:[0-9]{2,5})?(\/([a-z0-9+\$_-]\.?)+)*\/?(\?[a-z+&\$_.-][a-z0-9;:@/&%=+\$_.-]*)?(#[a-z_.-][a-z0-9+\$_.-]*)?\$"; and i want it to convert into javascript. please help The onChange is not calling my subroutine. I haven't played with JS in a few years, I'm sure this is stupidly simple. Any help is appreciated (or simpler way to do it!) Page is http://tinyurl.com/23l4k6w Here's the relevant code: Code: <form name="jump2"> <select name="comps"> <option value="0" selected># of Computers</option> <option value="1">1 Computer</option> <option value="2">2 Computers</option> <option value="3">3 Computers</option> <option value="5">5 Computers</option> <option value="10">10 Computers</option> </select> <select name="years" onchange="jump();"> <option value="0" selected>Years of Protection</option> <option value="1">1 Year</option> <option value="2">2 Years</option> </select> </form> <iframe name="buy_frame" src="" width="992" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe> <script language="javascript"> <!-- function jump() { if (jump2.comps.options[selectedIndex].value == 1) { if (jump2.years.options[selectedIndex].value == 1) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300318987]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } if (jump2.years.options[selectedIndex].value == 2) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199167]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } } if (jump2.comps.options[selectedIndex].value == 2) { if (jump2.years.options[selectedIndex].value == 1) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199158]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } if (jump2.years.options[selectedIndex].value == 2) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199168]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } } if (jump2.comps.options[selectedIndex].value == 3) { if (jump2.years.options[selectedIndex].value == 1) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199159]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } if (jump2.years.options[selectedIndex].value == 2) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199169]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } } if (jump2.comps.options[selectedIndex].value == 5) { if (jump2.years.options[selectedIndex].value == 1) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199160]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } if (jump2.years.options[selectedIndex].value == 2) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199170]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } } if (jump2.comps.options[selectedIndex].value == 10) { if (jump2.years.options[selectedIndex].value == 1) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199161]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } if (jump2.years.options[selectedIndex].value == 2) { window.open('https://secure.element5.com/esales/checkout.html?PRODUCT[300199171]=1&languageid=1&backlink=http%3A%2F%2Fwww.smartboxllc.com&cookies=1&nolselection=1&noquickbuy=1&showcart=1&affiliateid=200079763','buy_frame'); } } if (jump2.comps.options[selectedIndex].value == 0) { alert("You must select # of computers."); } else { alert("else");} //--> </script> on http://d11882157.a148.awebforyou.com...14_1422_p.html I use a javascript zoom but it disables the users from clicking on the link above the zoom is there any solution for this? Hello all, essentially i am grabbing a variable from the query string and i need to pass that value into another script. allow me to explain; usually i use this code to display a persons email address from the query string onto the page using document.write <script> function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } document.write(''); } </script> then i would display the var with this <script> document.write( getQueryVariable("Contact0Email") ); </script> ------------ ok so here is what i need to do. my client sent me the code below asking me to pass the email var into the javascript and image. my programmer friend said to use php and do smething like; <SCRIPT language="javascript" src="https://www.cpctrack.com/redirconsume.aspx?CID=25240&ORDERID=<? echo . $_GET['Contact0Email']; ?>"></SCRIPT> <NOSCRIPT><IMG src="https://www.cpctrack.com/redirconsume.aspx?CID=25240&p=img&ORDERID=<? echo . $_GET['Contact0Email']; ?>" width="1" height="1" border="0"></NOSCRIPT> this syntax does not work; <? echo . $_GET['Contact0Email']; ?> WHAT DO YOU GUYS THINK? Is the syntax wrong or are there better methods? Hi, I am working on a website now and I am experiencing problems with the gallery. It appears to work fine most of the time, however when you navigate between the galleries using the bottom left menu, occasionally either no large image will appear, and/or the thumbnails will highlight when rolled over, but nothing happens when clicked. I am using the Featured Content Slider from Dynamic Drive (Time was a concern getting this project done). The source code and pages can be viewed at http://www.metacomdesign.com/proofs/vfitz/current.html . Instead of posting snippets, I will just link to the whole thing, because I am not sure what parts to post. Thank you for your time Edit: Also, the pages that seem to be the culprits are Beauty and Covers/Advertising. Any help would be much appreciated Hey there. I've recently written a small javascript library that creates a unified interface for localStorage and sessionStorage. The code is here http://github.com/AndrewLowther/StorageItem I'm looking for people to give me feedback and to help me work on it should you so wish. Feedback is most welcome! I have been over this code several times and through as many tutorials as I can fine and I still can not figure out why it does not work. Is anyone here able to point out my error? The objective of the code is to get the size in pixels of the viewport when the browser loads page, and when the browser window is resized. After obtaining that number I want to use it to set the size of my DIV to 770px if the viewport has gotten shorter than than 770, and to auto if my viewport is larger than 770. Note, I am not posting the HTML or CSS code because it seems like this should be simple - I will gladly post that code if it turns out my question is not simple. Code: <script language="JavaScript" type = "text/javascript"> <!-- function inspectview() { var viewportheight; // most modern browsers if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight; } // IE6 in standards compliant mode else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportheight = document.documentElement.clientHeight; } // older versions of IE else { viewportheight = document.getElementsByTagName('body')[0].clientHeight; if (viewportheight <= 770){ document.getElementById("bg").style.height = "770px"; } else { document.getElementById("bg").style.height = "100%"; } } window.onload = inspectview; window.onresize = inspectview; //--> </script> Thank you in advance -Alaric_ Hello! Please take a look at my site: Test Flyout Lists As I hover over Item 15, I want it to be like, "Okay, this list I'm about to display is going to be too long, so let's disregard the 'top: 10px' line in the CSS and instead have the submenu sit with its last item right at the bottom aligned with the bottom of the gradient." That way, we know for sure that the submenu will not reach past the height of the body, and the last item will be visible. The bottom of the last item's cell should "hug" the bottom of the page/gradient. Can I do this in JavaScript? Hi people, I'm new to this and I was wondering how to adjust the iframe height by itself if my html height increases. My html code includes a facebook comment at the bottom of my page and the comment will show making it expand the height once users post comments. On the other hand, I'm using a CMS that have its own iframe. I've tried many solutions that can be found on the web but none works. It only can work if I don't put in CMS. Is it possible to adjust the iframe height using CMS or there is no way? I hope you guys understand what I'm trying to say. Hope to hear from you guys soon. Thanks alot. Hello, I'd like to make an iframe that will automatically get the height of the webpage it is on (not the source url) - I'm not talking the browser viewport but the entire document - so basically the height in pixels minus a certain value to prevent the iframe from sliding out - example: Code: <iframe src="http://google.com/" height="CURRENT DOCUMENT'S HEIGHT MINUS 50" width="FIXED"></iframe> Maybe it is better to achieve this function in php - or any other way? And perhaps there is some better way than an iframe - like a container of some sort that can automatically expand to the webpage's length... Thanks in advance! i want to adjust text size according to a page without scrollers. e.g the page should be shown that its scrollers are off and the text on the page spread from top to bottom.
I'm looking to do the following in javascript. Either on image_load OR on mouseover of an image, I would like to transition the exposure (or gamma, or brightness) of the image from over-exposed, down to the regular image. If that doesn't make sense, please see an example at: http://www.entheosweb.com/Flash/Phot...20/default.asp The coding for the example in Flash (Actionscript 3.0) is as follows: Code: function changeColor() { var colorComponent = 400; onEnterFrame = function () { myColor = new Color(big_mc_image); myColTr = new Object(); colorComponent = colorComponent + (100 - colorComponent) / 6; myColTr = {ra: colorComponent, ga: colorComponent, ba: colorComponent}; myColor.setTransform(myColTr); big_mc_image._visible = true; if (Math.round(colorComponent) == 100) { delete this.onEnterFrame; colorComponent = 400; } } ; } But as you can see, they use a built-in "TRANSFORM" function. In JAVASCRIPT, is it possible to affect the brightness/exposure of an image??? I know that alpha/opacity can be manipulated and would love to have this effect in my html/javascript code. I've attached the following code (simple fade in/fade out of an image). But would basically like to replace "OPACITY" with "EXPOSURE". Code: function fade(eid) { var element = document.getElementById(eid); if(element == null) return; if(element.FadeState == null) { if(element.style.opacity == null || element.style.opacity == '' || element.style.opacity == '1') { element.FadeState = 2; } else { element.FadeState = -2; } } if(element.FadeState == 1 || element.FadeState == -1) { element.FadeState = element.FadeState == 1 ? -1 : 1; element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft; } else { element.FadeState = element.FadeState == 2 ? -1 : 1; element.FadeTimeLeft = TimeToFade; setTimeout("animateFade(" + new Date().getTime() + ",'" + eid + "')", 33); } } I haven't come across any .js files that I can download. Know of any? Hey I was wondering, I have a box with tabs at the bottom. As you click the tabs, different stories appear in the box. However, I have the box in a fixed length. So if stories are longer, then they disappear beneath the visible line of the box. When I had it auto-adjusting though, the box would change based on the story I was clicking on. It gets weird. Is there a way to have the box auto-adjust based on the largest amount of text and have it stay that height regardless on what story you pick? I hope this makes sense. Thanks! KZ Please try a search on my webpage (search box is located at top of sidebar on the left): http://www.americanchic.net/help Here is the code implemented on the search results page: Code: <div id="cse-search-results"></div> <script type="text/javascript"> var googleSearchIframeName = "cse-search-results"; var googleSearchFormName = "cse-search-box"; var googleSearchFrameWidth = 500; var googleSearchDomain = "www.google.com"; var googleSearchPath = "/cse"; </script> <script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script> The original code (from my Google custom search control panel) included a FrameWidth of 600 and I changed it to 500 but it didn't make a difference. Any ideas? I'm wondering if anyone out there has a jquery solution to using an iframe that automatically adjusts it's height of the child and also works cross domain. Any help would be greatly appreciated. Hi, I hope someone can help me. I'll be honest and say I don't know much about javascript, but am fairly comfortable in html. I am building a website that will have multiple image swaps on multiple pages. I am building this in wordpress, and I'm guessing that means my approach will be different than if I wasn't using wordpress. Here's how one page would work: There are 10 images shown. 1,2,3,4,5,6,7,8,9,10. When number 1 is clicked on, I want a new image - 1a. When 2 is clicked on, 2a. So there are 20 different images in all on a given page. Also, I want the user to be able to click on the image again to restore the original image. I would prefer onclick to onmouseover. There will be literally dozens of pages like this on the site, managed by wordpress, so hundreds of images to swap. Basically the first image is a question - the second image is the answer. Is this possible? |