I am writing a DHTML application which uses AJAX to show dialogue windows etc.. (all the bells and whistles).When I display a DHTML dialogue in the foreground, I use JS to create a div which is a "layer" in between the foreground and the background which essentially "darkens" the background and disables all background functionality. Forcing the user to take action in the dialogue.How do I get the total scrollable area of the page so I know how big to make the "dark" div?I have tried all of these:
They all work in one browser or another, (I am testing in IE, FF and Opera) but none of them give me the correct values for the exact scrollable area of the page.
With jQuery cycle, is it possible to have more than one slide in the viewable area, and scroll one at a time? For example, assume that each letter below is a slide, and the viewable area is in [brackets] at load time:
writing a javascript function to calculate the area of a specific area in map element wich attached to image once clicked by mouse on the relevant hotspot? here's down my code i'm trying to complete:
i have 1 div with scrollbars and another div with a table inside. when user scroll horizontal bar in div1 i want application to scroll the table header from the same amount of pixels and in the same direction. i did not find anything under jQuery about that.. :-(
1. how can i detect in which direction the scroll is done (to the right, or to the left) ? 2. how can i determine how many pixels this scrolling is about ? 3. how to scroll the table header (table tag or th tag) from the same amount of point ?
i found just scrollLeft for now and i'm not successful to use it
how to make an image/text to scroll as the user scroll the page also? for example if the user scrolls down image/text also scrolls down and when the user scrolls up image/text also scrolls up..
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.
1. When I have the "<textarea>" code lines in it put a text-area on the page, but it puts all of the code following that first text-area line into the text-area box and doesn't execute that segment of code.
2. When there is no "<textarea>" (for the sake of seeing if the rest of it worked) it doesn't check the survey.
I'm stumped and can't figure out what to do at this point Code and pictures follow:
i have a table, with 2 numeric values at the minute, if the checkbox is selected I want the total price to be shown? this is the form I have with the numeric values
I am trying to write a script that will take a date of birth and another date and, if the person was over 75 years old on the createdDate, return "true" (otherwise return "false").
Unfortunately my code doesn't seem to return either 'true' or 'false'!
The code is:
var dateofBirth="30/10/1982"; var createdDate="01/12/2010"; var sd = dateofBirth.split('/'); var dob = new Date(sd[2],sd[1],sd[0]);
I want to create a link that a user can click which will create a popup telling the user their ip address. I have:
var ip = new java.net.InetAddress.getLocalHost().toString(); alert("Your IP address is: " + ip.substring(ip.indexOf("/")+1))
but this does not seem to work. It says the ip is 127.0.0.1. Strangely, this piece of code used to work but all of a sudden it doesn't for some unknown reason. Can anyone tell me what's wrong with the above code?
I have two date fields (check in, check out) and "number of days" field.
I want the script to calculate automatically the difference. For example: I have defaults dates, and I want the script to put the difference in "number of days" field. And if the user will change the date, the number of days will change automatically.
I am having difficulty getting the following assignment to run properly:Many companies charge a shipping and handling charge for purchases. Create a Web page that allows a user to enter a purchase price into a text box and includes a JavaScript function that calculates shipping and handling. Add functionality to the script that adds a minimum shipping and handling charge of $1.50 for any purchase that is less than or equal to $25.00.For any orders over $25.00, add 10% to the total purchase price for shipping and handling,but do not include the $1.50 minmum shipping and handling charge. The formula for calculating a percentage is price * percent / 100. For example, the formula for calculating 10% of a $50.00 purchase price is 50 * 10 / 100, which results in a shipping and handling charge of $5.00. After you determine the total cost of the order (purchase plus shipping and handling), display it in an alert dialog box. Save the document as CalcShipping.html.This is what I have after working on it round and round for 4 hours yesterday:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">[code].....
I've been googleing for a auto calculating form and found nothing, I just want something .. some form, that can add values from different fields ... and make a sum .. in real time ... meaning that ... if I put X value in field #1 and Y value in field #2, at the bottom or somewhere I should have the X+Y value :P..
Im trying to calculate the mean/average of numbers in an array.how can i get the length of an array to perform in a simple / maths problem whilst being flexiable to the length of the array?
I am writing a form and doing a bunch of calculations one of which is a percentage based on the value selected. I am returning a correct result for two of the values but for the other two I am not.The 'discount' value is what I am looking for. It should return as 0 for values of 1 but it is doing the math as though it is multiplying by 1. And again for the value of 6 it should be 10% but is taking the value as 4.6 or something.Code is below I've included all of it (sorry) for better ease of understanding the math that is happening:
I am not a developer so not so familiar with javascript. Suppose I have a map with ten junctions and based on that map. I need to calculate all the possible routes between one junction to another. How do I represent the map in javascript and how do I code the function to calculate all the possible routes?
I was wondering if it is possible to figure out the amount of time passed from a specific time in history till the present? If so how? I have tried so many different things and I am not getting the right returns.
I need help in calculating a score from a row of drop-down values. I need to use the onChange to tally the score as the user moves across 9 categories (with drop-down selection of 1-9 or N/A) multiplied by a weighted score. The final column for each employee would be the calculated score. I know how to accomplish this with vbscript but I need it to process on the screen so the user can see the calculated score as they make selections. Also the code needs to execute as many times as there are employee rows.(loop) I don't know how to do this with Javascript
Here's the VBscript with the variables involved Var S1 = Category 1 Weighted score Var S2 = Category 2 Weighted score Var S3 = Category 3 Weighted score Var S4 = Category 4 Weighted score Var S5 = Category 5 Weighted score Var S6 = Category 6 Weighted score Var S7 = Category 7 Weighted score Var S8 = Category 8 Weighted score Var S9 = Category 9 Weighted score D5 = 0.92 Var Q11 = Category 1 drop-down Value(1-9) * S1 Var Q22 = Category 2 drop-down Value(1-9) * S2 Var Q33 = Category 3 drop-down Value(1-9) * S3 Var Q44 = Category 4 drop-down Value(1-9) * S4
If (Category 5 Value = "N/A") THEN Q55 = ' ' Else Var Q55 = Category 5 drop-down Value(1-9 or N/A) * S5 End If
Var Q66 = Category 6 drop-down Value(1-9) * S6 Var Q77 = Category 7 drop-down Value(1-9) * S7 Var Q88 = Category 8 drop-down Value(1-9) * S8 Var Q99 = Category 9 drop-down Value(1-9) * S9
If (Category 5 = "N/A") THEN Var FinalScore = round(((Q11 + Q22 + Q33 + Q44 + Q66 + Q77 + Q88 + Q99) / D5),2) else Var FinalScore = round((Q11 + Q22 + Q33 + Q44 + Q55 + Q66 + Q77 + Q88 + Q99),2) end if
I have a div that is absolutely positioned and stretch on all sides using top: 10px; left: 10px; bottom: 10px; right: 10px; When I try to get the height of the div, using $('#id').height(); I get 0 (zero). Is there a problem calculating the height of elements like this one, or am I missing something?