Skip to content
Advertisement

jQuery target window and a scrollable div?

I’m trying to target the scroll event for both the window and scrollable divs. Is there a way to do this in one statement? I’ve tried… Only way I have found is calling them both separately… Answer There may be a better way to do this, but you could use $.map to create a jquery object with both window and

Jquery form submission not being triggered

I’m new to JavaScript. I have been trying to design some code which geocodes a location when a search button is hit and the submits the form if successful. To make it to slightly more complicated, if an option from the autosuggest is selected, it also geocodes it even before the search button is hit. This all seems to work,

How to create empty 2d array in javascript?

How do I create an empty 2D array in Javascript (without knowing how many rows or columns there will be in the new array)? If it’s a simple array var newArray = new Array(); I can assign as many elements as I want. But what about a 2D array? Can I create one without specifying the numbers of rows and

Check if localStorage is available

I know there has been many questions about checking for localStorage but what if someone manually shuts it off in their browser? Here’s the code I’m using to check: Simple function and it works. But if I go into my Chrome settings and choose the option “Don’t Save Data” (I don’t remember exactly what it’s called), when I try to

OnClick thumbnails – load image

I have a simple image gallery of about 25-30 photos with a thumbnails strip What i want is to load only the image that i click the thumbnail for not to wait until all the 25-30 photos are loaded because it slows down my website. Any ideas how to do that? Answer First, put all 25-30 photos on the page

Advertisement