Skip to main content

Posts

Showing posts with the label events

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

Click Entire Row (preserving middle click and ctrl+click)

I have an HTML table, with a link in the first column. I want to allow the user to click on anywhere in the row to activate that link. At the same time I would like to preserve the middle click and ctrl+click functionality of opening a new tab/window. Here is an example of the table: <table id="row_link"> <tbody> <tr> <td><a href="link1.html">link</a></td> <td>info 1</td> </tr> <tr> <td><a href="link2.html">link</a></td> <td>info 2</td> </tr> </tbody> </table> Using jQuery I can allow the user to left click anywhere in a row: $("table#row_link tbody tr").click(function () { window.location = $(this).find("a:first").attr("href"); }); This of course disables the standard middle click and ctrl+click functionality of opening a new tab. Is there a b

Attaching an event to multiple elements at one go

Say I have the following : var a = $("#a"); var b = $("#b"); //I want to do something as such as the following : $(a,b).click(function () {/* */}); // <= does not work //instead of attaching the handler to each one separately Obviously the above does not work because in the $ function, the second argument is the context , not another element. So how can I attach the event to both the elements at one go ? [Update] peirix posted an interesting snippet in which he combines elements with the & sign; But something I noticed this : $(a & b).click(function () { /* */ }); // <= works (event is attached to both) $(a & b).attr("disabled", true); // <= doesn't work (nothing happens) From what you can see above, apparently, the combination with the & sign works only when attaching events...? 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.

Prevent tap event on UITextView

2012-02-21 11:59:18.106 textView[20977:fe03] ; target= <(action=delayed:, target=)>> 2012-02-21 11:59:18.107 textView[20977:fe03] ; target= <(action=handlePan:, target=)>> 2012-02-21 11:59:18.108 textView[20977:fe03] ; target= <(action=oneFingerTripleTap:, target=)>; numberOfTapsRequired = 3> 2012-02-21 11:59:18.108 textView[20977:fe03] ; target= <(action=oneFingerDoubleTap:, target=)>; numberOfTapsRequired = 2> 2012-02-21 11:59:18.109 textView[20977:fe03] ; target= <(action=twoFingerSingleTap:, target=)>; numberOfTouchesRequired = 2> 2012-02-21 11:59:18.123 textView[20977:fe03] ; target= <(action=tapAndAHalf:, target=)>> 2012-02-21 11:59:18.124 textView[20977:fe03] ; target= <(action=twoFingerRangedSelectGesture:, target=)>> 2012-02-21 11:59:18.124 textView[20977:fe03] ; target= <(action=oneFingerTap:, target=)>> 2012-02-21 11:59:18.129 textView

Avoid event fireing for both parents and children

I have a menu built this way: ul li a li a li a The problem I am having is this: When a user clicks li a the li-function fires as well. The li -function should only fire if someone clicks just the li (misses on the a-tag). $('#stromSkjemaTabs li').children().mousedown(function () { $('#console').append('debug1 <br />'); }); $('#stromSkjemaTabs li').mousedown.(function () { $('#console').append('debug2 <br />'); }); Is there any way of writing this so only one of the functions fires? When clicking the li a the function containing "debug1" should fire (NOT debug2 too). When clicking li the debug2 should fire. I've tried every combination of children() but I can't get this to work. Any cleaver heads out there?

Avoid event fireing for both parents and children

I have a menu built this way: ul li a li a li a The problem I am having is this: When a user clicks li a the li-function fires as well. The li -function should only fire if someone clicks just the li (misses on the a-tag). $('#stromSkjemaTabs li').children().mousedown(function () { $('#console').append('debug1 <br />'); }); $('#stromSkjemaTabs li').mousedown.(function () { $('#console').append('debug2 <br />'); }); Is there any way of writing this so only one of the functions fires? When clicking the li a the function containing "debug1" should fire (NOT debug2 too). When clicking li the debug2 should fire. I've tried every combination of children() but I can't get this to work. Any cleaver heads out there?

How can i get all calendar and its events from iphone app?

Good Day to you. I have used iCal events in my app. I have add events to iCal and retrieve/delete the events from iCal from my sample iPhone app. Now, i want to show all the calendars what are the calendars user synced in their iPhone(Eg : Google calendar). Then i want to retrieve the events from other calendars except iCal. How can i get all the synced calendars from iPhone? I searched my level best in Google but, can't to get right answer. Can you please help me? Thanks in advance.