Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

jquery - trigger alert on div's mouse out -


im testing out here,so please excuse css rules.i have got ul list in div,and im trying trigger alert on mouseout of div alert triggers each time mouseout li items in ul. please tell me reason behind it? guess bubbling im not sure.

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>untitled document</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />  <style> #box{ cursor:pointer;width:300px;height:500px;background-color:#f1e0bb; }  ul#mylist{ list-style:none;padding-top:20px; }  ul#mylist li{ font-family:arial;font-size:20px;font-weight:bold;height:40px;cursor:pointer;border:solid 1px #000; } </style> </head> <body>  <div id="box">     <ul id="mylist">         <li>item 11</li>         <li>item 12</li>         <li>item 13</li>         <li>item 14</li>         <li>item 15</li>     </ul> </div>   </body> </html> 

jquery script used

$('#box').mouseout(function(){  alert("ccc");  }) 

use mouseleave event here instead, doesn't fire when leaving children:

$('#box').mouseleave(function(){   alert("ccc"); }); 

you're assumption bubbling correct, it's child elements bubbling that's triggering handler. .mouseleave() docs:

the mouseleave event differs mouseout in way handles event bubbling. if mouseout used in example, when mouse pointer moved out of inner element, handler triggered. undesirable behavior. mouseleave event, on other hand, triggers handler when mouse leaves element bound to, not descendant. in example, handler triggered when mouse leaves outer element, not inner element.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -