I am creating a simple one page application that allows someone to curate a list of json feeds. I had a problem trying to bind the mouseenter / mouseleave event to all the inputs on the page with this class. Just put the first work, and the second - no.
I need to execute jquery:
$(".feed").on("mouseenter", ".publish", function(){ console.log("feed") }); //this is for test purposes $(".feed").on("mouseenter", ".keys-input", function(){ console.log($(this)); $(this).siblings(".delete").fadeIn(75); }); $(".feed").on("mouseleave", ".keys-input", function(){ $(this).siblings(".delete").fadeOut(75); });
and the following html:
<div class="feed"> <div class="feed-header"> <h2>pga-2013.json</h2> <button class="publish button-white-bg button-save">Publish</button> </div> <div class="kvRow collapsed"> <span class="delete icon">x</span> <input type="text" class="keys-input" value="free" disabled=""/> <input type="text" class="values-input" value="0" disabled=""/> </div> </div>
The reason I ask if there is a maximum number of elements you can bind to is because the ".feed" event ".feed" and there are only 11 of them on dom, while the ".keys-input" event is missing, and there are 7266 of them at home. Either that, or I'm blind and doing something dumb ...
here is a fiddle with fewer elements, but the same code that works http://jsfiddle.net/khLPc/
this is the problem: Event on a disabled input , inputs are disabled, so they wonβt trigger events that are bananas for me ...
source share