jquery plugins - Livequery fires click no matter where the user clicks in the document -
I changed the traditional selection / option form elements with a nifty short popup window while clicking on the trigger image. The page is for accounting purposes and therefore many line items are expected. I have written javascript which will dynamically select new line item / selection elements. When the page is loaded, the initial set of option loads and users can click on it, with some options pop up can get , One can choose and then the box stops. The steps for the next choice and so on and even further. I've added livequery to my code for those dynamic elements ... livequery ("click" ...) does not matter where the user clicks on the page. Very disappointing
I've read here that how great is "jQuery" in jQuery, but I'm not fully able to upgrade to 3G because custom js depends on file 1.2, so Live () is out of the question, although I have implemented the livequery () plugin and I really need to understand if I am using it correctly.
I will post partial code.
Actually, I'm searching to start with the divs "bubble" and then a number later. Then run the event on each of them, only the bubble 1 is constant, the two are up and running. Am I not using LiveCurry completely?
& gt; $ Jb ('div [id = "bubble"]) Filter (": first"). Attr ("id");> var i = divid.substring ((pref. Length)); var triggers = $ jb ('# triggers' + i, this);> var popup = $ jb (' # Pop '+ i, this). CSS (' Opacity ', 0); Var selectedoption = $ jb (' selectedOption '+ i, this);> Var selected text = $ jb (' Selected OpenText ' I, this); $ jb ([trigger.get (0), popup.get (0)] livequery ("click" for short, function;) (& gt; // alert ( I); // The code has been removed (just the contents of the popup) & gt;});
You probably want something like this:
$ ('div [id ^ = "bubble"]) Livequery ("click", function () {var divId = $ (this) .attr ("id"); Var i = divId.substring ("bubble". Length); Var triggers = $ ("#triggers" + i, this); Var popup = $ ("#pop" + i, this). Css ("Opacity", 0); // Alert (i); }
Comments
Post a Comment