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.

css - adjust the child position to the center of the parent in jquery -


i'm prototyping navigation site sits on bottom of window. when hover on link div appears above naivigation sub-links, not position centrally above hovered link in navigation. i've tried using css position -50% left has had of effect [looks move 50% left of parents size], how do using jquery?

note: i'm using hoverintent.

position (fixed) 1 pixel wide container div instead, , offset inner element (your actual item) half of absolute width. trick has worked me.

html:

  <style type="text/css">     #testnav-container {       position:fixed;       bottom:0;       left:50%;       width:1px;       border:1px solid red;       text-align:center;     }     #testnav {       height:20px;       width:100px;       background:blue;       margin-left:-50px;     }   </style>   <div id="testnav-container">     <div id="testnav">test navigation bar</div>   </div> 

the 1px border on container div show where's at. try out , tell me how goes.

snippet jquery example run in console:

var foo = $('<div style="position:fixed;bottom:0;left:50%;width:1px;border:1px solid red;text-align:center;"><div style="height:20px;width:100px;background:blue;margin-left:-50px">test navigation bar</div></div>').appendto('body'); 

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 -