Tuesday, 15 May 2012

javascript - can percentage be provided in iframe tag of html5 tag for height and width? -



javascript - can percentage be provided in iframe tag of html5 tag for height and width? -

i creating application dynamic graphs in html5 , javascript.. want 4 graphs on screen displayed 4 quadrants on device, application works. code have created

<!doctype html> <html> <head> <iframe src = "file.html" height="500" width="500" align = "left" frameborder = "0"> </iframe> <iframe src="file2.html" height="500" width="500" align = "middle" frameborder = "0"></iframe> <iframe src="file3.html" height="500" width="500"align = "middle" frameborder = "0"></iframe> <iframe src="file4.html" height="500" width="500"align = "middle" frameborder = "0"></iframe> </head> </html>

yes can provide height , width in % iframe. although there grab it.

if give css iframe this

iframe { width: 100%; height: 100%; }

you notice width attribute makes changes, height attribute not create changes.

to create work have specify height parents of iframe, in case body , html . css

html,body{ height: 100%; } iframe{ width:60%; height:70% }

now changing height in iframe reflect changes.

here fiddle

javascript html iframe

No comments:

Post a Comment