I have an element on my page absolutely positioned. Im trying to write a snippet of jQuery to make that element scroll at a slower rate than the rest of the elements on the page. I’ve written this so far but cannot seem to get it too work at all. Has anybody experience with this and if so would you
Are JavaScript Arrays actually implemented as arrays?
The difference between a JavaScript Array, and Object is not very big. In fact it seems Array mainly adds the length field, so you can use both Arrays and Objects as numeric arrays: So my questions is, in popular JavaScript engines (V8, JavaScriptCore, SpiderMonkey, etc.), how is this handled? Obviously we do not want our arrays to be actually stored
Check if date is less than 1 hour ago?
Is there a way to check if a date is less than 1 hour ago like this? Also, different question – is there a way to add hours to a date like this? Answer Define then you can do To get one hour from a date, try
How do website heatmaps get accurate data?
There are services like crazyegg.com that show you where visitors are resting their mouse cursors on your web page. My question is, given that people have different screen widths how can they be sure that my x coordinate is the same position on the page as another persons x coordinate? Meaning, two people may have the same mouse x coordinates,
How to check whether multiple values exist within an Javascript array
So, I’m using Jquery and have two arrays both with multiple values and I want to check whether all the values in the first array exist in the second. For instance, example 1… Array A contains the following values 34, 78, 89 Array B contains the following values 78, 67, 34, 99, 56, 89 This would return true …example 2:
Javascript sort function. Sort by First then by Second
I have an array of objects to sort. Each object has two parameters: Strength and Name I want to sort first by Strength and then by name alphabetically. I am using the following code to sort by the first parameter. How do I sort then by the second? Thanks for your help. (I am using Array.sort() with the aforementioned sortF
Open new window on background div click
I am using CSS to apply a background image to a div tag that wraps all of the content on a website. And the CSS id with the background property… PROBLEM: I’m trying to figure out how to open a new browser window to a different URL whenever the background image is clicked upon. I have tried doing this using
How to communicate between iframe and the parent site?
The website in the iframe isn’t located in the same domain, but both are mine, and I would like to communicate between the iframe and the parent site. Is it possible? Answer With different domains, it is not possible to call methods or access the iframe’s content document directly. You have to use cross-document messaging. parent -> iframe For example
Body OnClick doesn’t work… but the onclick works when attached to a tag?
I have the following Onclick event: and when I attach it to: all works fine, but I want it as a body onclick event as follows: and I get no dice. The only thing to note would be that the class “g” already has a background image specified, but I don’t think that should matter. Answer Use this. like this
is there a way to exchange variables between JavaScript and PHP
I have build a website in Drupal, and I am trying to create a fun way to get members involved with the site by building a userpoint system, the system is all in place, but I’m trying to make a shop where they can buy ‘titles’. This is the script I wrote for the shop, with a bit of error