Tuesday 15 September 2015

jquery - How to fix the width and height of div and make the content inside div resize to div's width and height? -


I have a div with id I am using jquery to change div html

In HTML IFrame with large width and height, I should be divisible with fixed width and height, and the content of the iframe should be the width and height of the divs

Help.

Whatever I tried to do it, but it is not working.

  & lt; Div id = "mydiv" & gt; & Lt; / Div & gt; & Lt; Script & gt; Get Var html = // from somewhere for example & lt; Iframe width = 300px height = 500px & gt; & Lt; / Iframe & gt; JQuery ("# ​​myDiv") attr ("max-width", "200px") JQuery ("# ​​myDiv") attr ("max height", "300px") .; JQuery ("# ​​myDiv") HTML.   

Iframe content is generally unknown about it The "guardian" container, so the size of its contents is not guaranteed if you want to resize the content of your iFrame ... it can be done only via javascript if it is in the same domain or if its If there is a separate domain, url will need parameter / logic and javask based on those parameters The size of the material will be changed through the replay.

No comments:

Post a Comment