Skip to main content

Posts

Showing posts with the label javascript-events

Detecting a image 404 in javascript

After a user uploads a file we have to do some additional processing with the images such as resizing and upload to S3. This can take up to 10 extra seconds. Obviously we do this in a background. However, we want to show the user the result page immediately and simply show spinners in place until the images arrive in their permanent home on s3.

Pass mouse events through absolutely-positioned element

I'm attempting to capture mouse events on an element with another absolutely-positioned element on top of it. Right now, events on the absolutely-positioned element hit it and bubble up to its parent, but I want it to be "transparent" to these mouse events and forward them on to whatever is behind it. How should I implement this? Click here for an example page . All its divs flash on mousedown. Source: Tips4all

GWT Custom Event Handler

Can someone give me an example of creating a custom set of an Event and a Handler. Say you have a Person object that you want your widgets to know if it got updated. You create a HandlerManager and now you have to create an Event and a Handler. How would you define those classes so that you can subscribe and fire events? Most of the Events are DOM based, while I want to create some custom events and handlers that I can fire outside of any browser-based event.

Recursion in jQuery event

This event is attached to a set of elements: var elems = $(this).filter(function(){ ... }); How can I trigger a change event on these elements within a change event handler, but ignore the current element? elems.bind('change input', function(){ // do some stuff... // then trigger change, but not on "this", to avoid the recursion issue elems.change(); }); Basically I want ot ignore this from elems , but only in my "manual" change()-call above...

What javascript event gets fired when ios safari gets called from another app

I'm working on a mobile website / iPhone app combination. Upon entering the mobile website, I prompt the user to 'go to the app', 'download the app', or 'use mobile website'. From various entry points to the mobile website, I'm mostly worried about verification emails and text messages, so the user will check email, follow the verification link, enter Safari, get prompted to 'go to the app' and the verification link is sent to the app for it to handle. Now in the same session, if the user gets another email regarding the app, the user will check email again, follow a different verification link to Safari, and I want the 'go to the app' to work the same with the new link. Some quirks are that upon entering the mobile website, the verification link is stored and the URL is switched to site.com/home. The iphone overlay is completely separate from the rest of the site and doesn't have access to the site's storage of the verifi

jQuery function is not working as i planned, DIVs just disappear on click

I have a script here, and it works amazing, except for one small detail. It basically runs as click function that fades in and out certain DIVs on the click of a link. The problem is, however, that when you click ANYWHERE on the page, it removes the DIV and leaves an empty content area until you click one of the links. Obviously this is a problem. I can't use the exact code I'm using for NDA reasons, but here is same setup I am using with just some plain text in the divs. Just click the links to see the functionality, and then click anywhere else on the page (in the div, in the white space, whatever) and watch the div just disappear. I'm know that that is what the javascript is calling, but I don't know how to disable the click in the divs so this doesn't happen. Also, how to do that so it doesn't disable the link that are within that div. Any help is greatly appreciated. This website is a life saver. This is the original code I got off of this site