Little Animation That Slides Some Div Fields To The Right A Short Distance?
Sep 1, 2009
I've got this lovely little animation that slides some div fields to the right a short distance. Everything works except the setTimeout (located in the SlideIn function). It simply 'jumps' without taking any time at all. I've tried a bunch of stuff:
changed the amount of time from 100 to 10000
changed it from var t = setTimeout("SlideIn()", 1000)
SlideIn with/without the brackets, with/without the quotation marks.
I've used Brian Crays driving distance calculator on a site, however the calculations are not accurate for full addresses. I realise the v2 google maps api is now depreciated, my question is, if I upgrade to v3, is there more accurate calculations of distance and if so, does anyone have an example of calculating the distance between two points with the new api?
or does anyone know how to get more accurate results with his code?
What i'd like is a simple converter to allow a user to input the distance travelled in miles and the time in hours and minutes, the result being an average speed. What i'd appreciate is for someone to write the script for me and post here if possible.
i've found out how to find the distance between 2 lat lng points using google's distanceFrom method:
Code: // NR14 7PZ var loc1 = new GLatLng(52.5773139, 1.3712427); // NR32 1TB var loc2 = new GLatLng(52.4788314, 1.7577444); alert(loc2.distanceFrom(loc1) / 1000);
However, I'd like to be able to convert a distance to lat lng. The main reason I'm doing this is so that I can figure out the bounds of a certain area of a co-ordinate. For example I specify a point, and then I need to draw a box around this area going x distance North, South, East and West, but until I know how many units make up a kilometre this wont be easy.
I guess I could go to google maps, click on a point and then click on another point and keep doing that until I get exactly 1km away from the original point, then just minus or plus for the lat and lng to find out the unit value for 1km, but I have a feeling that this wont be accurate. Can anyone lend any advice, I realize that what I'm asking is more a map question than a google maps javascript api question, but perhaps someone has come across this before?
Alert shows the distance from input to the top of the table or table cell. Is there any other attribute which shows the absolute distance from input to the top of the page ? Because of some reasons I can't add table's and input's offsetTops.
I want to show some message in a box when the mouse is over a button (examples: undo, save, open, ecc ) like in some interface. I don't want to display the mesage in an alert window.
I've been tasked with fixing a problem on a site that I didn't develop, but in a nutshell somebody wrote a little Javascript that appears to only be working in IE. I'm not sure why...would anybody be kind enough to have a quick look?Page in question is: http://www.thomastonauction.com/newA...eSignature.phpThe script not working is in the head of that page, and looks like this:Code:<!--this appears to be the script that is called when users click the "submit to thomaston auction" button,which should trigger an email containing the bid info. to "auction@kajav.com" and open a printable copy of the bid in a new window ("newAbsenteePrintForm.php")-->
<script language="JavaScript" type="text/JavaScript"> function openPrintForm(sid) {
I am using a simple javascript slide show. The actual width of it is fine, but the scrolling part is messed up, it's suppose to start at the very right and scroll all the way left. Instead it scrolls in like a 150px area and repeats. How can I get the picture to scroll the entire length?[code]...
I am doing some work, where I want to have a table heading that remains in a fixed position, when the window is scrolled (I will ultimately have a very long table). I have written the code below, which fixes the heading.
I am trying to make it so that each body row of the table gets hidden, when the window is scrolled such that the row passes above the heading row.
To do this I need to somehow detect the distance of each row from the top of the window as the window is scrolled so I can detect when it goes above the fixed heading row. I have tried to do this using offsetTop and scrollTop in the code below, but it doesn't seem to be working (in Safari at least, which I am using for my main testing).
Does anyone know a simple way of detecting the distance to the top of the window so I can use it in my code below, which will work in all browsers?
(I don't really want to use div, and overflow-y:auto to achieve the fixed heading scrollable table, because I don't want to have a sub-section with its own scrollbar. I just want to have the main page scrollbar when the list gets long enough to require it.)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head>
I've found the Harvesine forumla to get the distance between any two points of latitude and longitude on the earth's surface. What I want is a little different - I want that, given a point and a distance, to get the latitude and longitude of a second point. I'm having trouble reversing the forumla. The current formula:
In all the easing functions (based on Robert Penner), I see that they require the distance to travel to be known beforehand. But what if I didn't know that? How would I calculate the change to position based on easing my speed to zero if I know my current speed?
In other words, I know my start position, my current speed and the duration. I want to figure out the change in position (for each step and total change).
I'm currently doing on a project, frankly speaking i'm new in javascript only know the basics. I'm not even sure whether this thread is suppose to be here or under html.. I'm suppose to create some codes that enable a html page to load to the next html page when the mouse move from left to right within a specific time and distance(positive X coordinate) and also the other way round (right to left) once i figured out this. I've got an example online and edited it. Please take a look at my codes.
[Code]...
test01.html is just blank page created to make sure it loads. However i would like to load from test01 to another html page but no matter how i tried to edit the codes, there's errors. I cant possibly copying and pasting the exact codes to every page i want to load to right? And is it possible to sortof increase mouse sentivity such that i can most probably load to the next page in first few tries of moving the mouse on the first page. Is it common that when i launch the html on IE and Firefox somehow after showing the first page for maybe 1 second, it immediately jumped to 2nd page and i have to go back to 1st page to try out.
I have a button which is animated with a rollover effect, obtained through jQuery of course. I wish to open a lightbox clicking that button and I tried with a simple, self-made lightbox and with FancyBox but in either case the lightbox is displayed without animation.I post the code for my buttons and the lightboxHTML for buttons:
I've been messing with this code to make a fade in animation with setTimout. The only thing is addition isn't working on the fade in. A subtraction on a negative works though. This seems strange to me.
changeit.style.opacity -= -0.01; works but when it's changed to changeit.style.opacity += 0.01; there's no fade in. It's the only thing I change. My intuition says to me it should work with addition, but maybe there's something I'm not understanding.
<html>
changeit.style.opacity -= -0.01; if this is set to changeit.style.opacity += 0.01; it doesn't work. What?
Of course this is all just for Firefox for now. If I put this in something useful I'll change it so it'll work in other browsers later.
I am coding a page that has 6 buttons on it, from which one is the correct button (the target). I want to try and implement the following:
1) when a wrong button is clicked, the file "wrong.mp3" is played. It is less than a second long.
2) when the correct button is click, the file "right.mp3" is played. It too is less than a second long. The page then redirects/reloads. This is the code that I can't seem to get to work:
I need help with a code that will generate a random number or integer (from 1-9). Does anybody know of a short random generator without having to import anything?
I have 2 lists and function to clean them function del_sel(option){ if (option == "1"){ document.forms[0].list1.innerHTML = ''; }if (option == "2"){ document.forms[0].list2.innerHTML = ''; }}
How to make this function shorter & without options? Something like that: function del_sel(option){ document.forms[0].option.innerHTML = ''; }
The problem is that this code returns mistake: function del_sel(option){ document.forms[0].option.innerHTML = ''; } ... <input type='button' value='Delete onclick='del_sel(form.list1);>
Looking at the sample code below, if you click the same link over and over, I get the desired result / animation of the revealed div. If however you click 'link 2' then any link except 'link 2' the animation is different. What do I need to change in my logic to always get the desired result despite which link was clicked?
I need a program by which I want to open several web link autometically after a short interval. E.g. open google.com, then wait for 10 sec, then open yahoo in the same window, then wait for 10 sec, then open gmail, wait for 10 sec, then myspace, and so on.......
Not sure if the root problem is a js load issue or rather css. Problem page is here: [URL] I've had success using the Lightbox2 module on several Drupal-based sites, but this is the first time I've handled the straight code and tried to drop it into a hand-coded site. Internet Explorer fails to draw the overlay div to the full page height. Firefox 3 performs as expected.
The web site suggests setting the body margin and padding to zero, but those were set anyway and tweaking didn't help. Another suggestion was to stick initLighbox() into the body onload, but that function doesn't exist. Also tried initialize() and Lightbox.initialize(), but again it's claimed those functions don't exist. Looking into the code, however, initialize() is where the div height is calculated, I think. It should be noted that the lightbox still works on IE even when using one of these failed onload attempts. And I don't actually get IE to report any js error with the onloads - I have to rely on Firebug for that.