I think the offset() function returns node's position relative to document. The attached html file prints the offset value to console when the box is clicked. I expect the same value would be printed every times. However, when the script is run on iPad (with simulator), it print different value when I zoom and scroll to different position. This problem does not occurred in iPhone.
I have a list of links to PDF articles, each link has a corresponding div that contains an introduction to the article. I'm using the onmouseover event in each link to show the corresponding introduction div and hide all the others.
The order and number of the pdf links and the introductory divs are the same. The code below works in IE but not in FireFox - the problem in FF is the index returned from the onmouseover event is double what it should be, so the first PDF link shows the second div, the second PDF link shows the fourth div ect.
I'm using inArray() to check an XML tag against an array called status[]. If the result != -1, then do one set of instructions, else, the item is 'available' so do another set of instructions. Each entry of my XML document has a <status> tag, which will contain one of 3 values, or a 4th option 'available'. I have an array setup called status['sold', 'pending', 'reduced']. If the <status>.text() is one of these 3 values, then we'll get the array position, if it's 'available' we should get -1.
When I run this in Firefox (3.6) & IE (8.0 or Comp Mode) it works fine. However, when I run this in Safari (4 or 5) & Chrome, it returns the value -1 for each of the entries. The 3rd, 5th, & 7th entries are all set to <status> 'sold' and inArray() should be returning a 0.
I am trying to declare a variable inside a function and use it later on in my code... but it just already returns white space... i.e. not variable value. I am setting it within this function:
function show_video1(){ document.getElementById('video1').style.display="block"; var video1Name = "Education World News (Part 1)"; document.getElementById('video2').style.display="none"; document.getElementById('video3').style.display="none"; document.getElementById('video4').style.display="none"; [Code]...
and trying to call it later on with this: <script type="text/javascript">document.write(video1Name)</script> It might be worth noting that each one of my 11 videos will hace a different name.
The white my notes section on the bottom left is a div area that is loaded with an Jquery Ajax call just like 2 other areas on the page. This works fine in IE, Safari (PC), Chrome but not in Firefox. It just shows blank white.
I've been writing a new layout for part of my web page.
The java script is not creating the list. When I check Firebug I get an error:
QuoteMovies[movctr] is undefined [Break On This Error] MovieList+= Movies[movctr][2]
If I take out the var MovieList and just have it print the text "MovieList" instead of the contents of MovieList the code tries to run. I'm not sure why it won't copy the content of the var MovieList.
Live test version of my movie page
Here is my code:
It's also weird that is says that Movie[] is undefined instead of Movie[][].
Every time i click on one of the said elements, it puts "undefined" into the textbox each time i click on an element.it seems to me that the Key_Table[x] is not getting passed correctly. How do i make sure that this is getting passed correctly?Here's my Code:
<script type='text/javascript'> // Startup Script if (document.addEventListener) {
I am trying to access the width variable from my main page. Within the imageinfo.js script functions I can alert() the width value which returns 1024. But I can't seem to pass this variable to my main page or access it directly so that I can use document.write() to write the variable on the page. Whenever I try to call the 'width' variable directly from the main page I get undefined. How can I access this variable? However, with the test code below, I was able to get ducument.write() to write the 'width' variable on the page but now the page doesn't stop loading - there's an endless loop in the code...
Two objects on an html page. An event on object 1 effects object 2 $(".video_rg").mouseover(function(event){ var myTriggerId = event.target.id; var myTargetId = 'video_' + myTriggerId; document.getElementById(myTargetId).src = 'images/test_object_2.gif'; // this works // $('#myTargetId').src = 'images/test_object_2.gif'; // this does not }); My assumption (we know about those) is that I am not passing the data to the $() function correctly, that it is reading '#myTargetId' as a string, and not a variable. I just really want the JQuery code that would do what the document.getElementById code is doing.
Either I'm having a really dim Friday, or something strange is going on. I'm trying to add a method to the Validator plugin, using the following regex:
I am pretty new to Javascript having a bit of a problem with a website with Google Maps integrated. URL I have two checkboxes (ccCheck and caccCheck). The basis is when the box is ticked, it overlays a KML onto the map. This is working fine in Chrome, but in FF and IE it doesn't work, IE returns 'ccCheck is Undefined'. The code I am using is in the JS file, the bit it gets stuck at is as follows:
[Code]...
If I stick a ccCheck = document.getElementById('ccCheck') within the onclick function (before the if statement), it places the overlay onto the map, but then when I untick the box it just stays there. It's such a simple thing (I think), and must be down to IE being pedantic about declaring the variable properly, the question is how should I be doing this?
If I do not have enough information provided, please tell me. I am VERY weak when it comes to Javascript.I am trying to pass the variable status using a form and it works in IE, but not in Firefox/Chrome.How it is called;
I noticed weird results when using eval() to do some simple calculations. Here are a few eval() statements and the corresponding results from javascript:
This can happen with other numbers as well, but certainly not with any combination. I have confirmed this on Firefox and Safari, two different versions of OS X and both Intel and PowerPC Macs.
I'm just getting into jquery and was testing to see how I could handle php/mysql errors on my ajax function page. I thought that if I set the datatype to xml and since the error page was html it would throw an error but it doesn't. How can I handle this?
I am pulling in an XML doc, storing it in a global var and through out the app I am transversing it to grab certain info. Up till 1.2.6 it's been working fine, but when I upgraded 1.3.2 I get bad results.
Here are my two test pages:
[URL]
My guess is the it has something to do with Sizzle but I can't place exactly where the issue may be happening.
I'm developing a chess game recorder (records chess games just like electronic score sheet) and i am trying to write a function that handles the "en passent" rule in chess. However, when i try to test to see if a Black pawn is at a particular x,y location, it is always giving me back "50px". Even when it's not at that location. i uploaded semi-live version to my website here: [URL] you just click on the 'Play' button to start the game here's the function in question:
However, I finally ran into a problem that I can't figure out. When I try and get the width of any cell in a table it's returning a width of 83 or 84. I have the table inside a div that has a width of 757px. I don't have a width set on the table itself, but each cell is set to 100px. I've tried to set the width in a css file and inline neither of which give me the 100px that I'm thinking it should return. I've tried both width(), outerWidth() and innerWidth(). The only one that returns a different number is outerWidth.
Does anyone know of a place to get a code that looks at what is typed in a textbox and displays a green checkmark or a red x next to the textbox if the value entered is invalid. Eg. if no @ is entered in the email field, a red x would be shown next to the email field. Eg. if a zip code contains letters, a red x would be shown next to the zip code field. Eg. if the email field contains a @ and a period, a green check would be shown next to the email field. Etc. The green check or red x would have to be shown either as the user is typing or after they go to the next field (Blur).
Code: <script type="text/javascript"> $(document).ready(function() { for ($i=0; $i<4; $i++) { var num = $('.clonedInput').length; var newNum = new Number(num + 1); [Code]...
all works well, less one thing. The id names of valores are incorrect in the last loop.
I should imagine others here have experienced it. The user completes your form, and they unintentionally input their email address incorrectly. Then when you reply to their form, you then get the mailer daemon returning your email! Now, there's a couple of ways that some websites try to solve this problem - some ask the user to input their email address twice, some show the forms results on the next page, so that the user has a last chance to check, before completing the submission. Are there any other ways of trying to ensure that, as much as possible, that the user inputs the correct email address?
Im working on some drag and drop logic similar to the jQuery shopping cart example, but I've run into a small hitch. If I double click on the LI within my 'dropped' area it causes them to become draggable again. I specifically set up drag to only work from one source list, so Im unsure how double clicking is causing this bug?