javascript/jquery: focus() not working -


I want to focus on a special ID (in roundcube) by a keyboard shortcut. Html is

  ... div 

I tried the following:

  // strag + tab, nachchenbereich zoo commen ... and if (event.keyCode = = 9 & amp; amp; amp; and event.ctrlKey) {Warning ("Taste Errant"); //document.getElementById("messagetoolbar ") focus () .; . // $ ("# messagetoolbar") focus (); Settimesout (function ($ ('#MessageSutBarBar'). Focus (); Alert ("Zeit");}, 3000);} ...   

First Alert and Second Alert

Edit: I think I should describe it better: I want to mark the first row / roundcube Email in Email-Inbox Inbox has a table with a T-tag ... when I have your solution Try, the first line is dotted, but with the entry I can not open the mail and with the other keys I can not mark the first row / mail ... I think that to mark the first line, "one left-horizontal simulation must "...?
now I've tried to use jquery. Trigger inbox table html

  & lt; table id =" messagelist " Class = "record-table messaging sort-job fix header "& Gt; & LT; thead & gt; & LT; tbody & gt; & Lt; tr id =" rcmrow27428 "class =" message "& gt; & Lt; td class =" Thread "& gt; & Lt; / Td> & Lt; td class = "date" & gt; 16.04.2014 13:41 & lt; / Td> & Lt; td class = "toto" & gt; ...   

I tried to use ...

  $ ('# messagelist tr'). eq (1) .addClass ('Message selected focus') removeClass ('decentralized') trigger ("click").   

... but it does not work: it adds a square, but does not really focus on the line :-( It works with "button"

Edit: I think roundcube's file list.js is important for that question. I found the following:

  / ** * list * / focus: function (e) {var n, id; this.focused = true; for (in this selection.) {Id = this.selection [n]; if (this.rows [id] & amp; Amp; this.rows [id] .obj) {$ (this.rows [id] .obj) .addClass ('selected'). Remov eClass ( 'unfocused');}} // already focused focusing elements (# 1,487,123, # 1,487,316, # 1,488,600, # 1,488,620) / It seems that Windowkfocus () works for all browsers but Firefox (# 1489058) $ ( 'iframe ,: focus: not (body)'). Blur (); window.focus (); if (e || (e = window.event)) rcube_event.cancel (e );},   

Does anyone know how to modify or mention my question? Thanks!

Add tabindex = 0 div to which you want to focus and you div Security will be able to set the focus using. Focus ()

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -