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.

javascript - determine if an element is scrollable in html document -


hi i'm trying check if html element scrollable.only gecko support needed (and webkit support nice not necessary). documentation tells scrollheight , clientheight same when element has no vertical scrollbar https://developer.mozilla.org/en/dom/element.scrollheight discovered gecko adds margin size scrollheight. so, element margins, scrollheight superior clientheight. https ://bugzilla.mozilla.org/show_bug.cgi?id=576976#c2

so, use like:

var clientheight = element.clientheight; var bordertop = window.getcomputedstyle(element,null).getpropertyvalue('border-top-width'); var borderbottom = window.getcomputedstyle(element,null).getpropertyvalue('border-bottom-width'); var scrollheight = element.scrollheight - parseint(bordertop, 10) - parseint(borderbottom, 10); 

it works fine except in 1 case: when use firefox zoom. let's have border of 1px around element. clientheight , scrollheight have difference of 2px (1 top, 1 bottom). unfortunately, window.getcomputedstyle(element,null).getpropertyvalue('border-bottom-width') less 1px when user zooms page.

so, there reliable way determine in firefox if element has scrollbars ?

use offsetheight instead of clientheight since includes border, needn't concern that.


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 -