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 - Copy all styles from one element to another -


how can every styles (even inherited) element element b ? in javascript or using jquery.

let's tell have element <p class="foo">...</p> , append new element <div /> same, except content.

if don't care ie, can this:

var p = document.getelementbyid("your_p_id"); var div = document.createelement("div"); div.innerhtml = "your div content"; div.style.csstext = document.defaultview.getcomputedstyle(p, "").csstext; 

this works inline, embedded, , inherited styles.

edit: , "don't care ie," of course meant "don't care except webkit."

update: works in current versions of chrome(19), safari(5), firefox(12), , ie(9). it works in older versions of some, such ie8.


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 -