0

I had the frameset on both sides of page, and i have a middle page

with the middle page, i am trying to check the width of the page to load content within a div and width should be calculated and if it is bigger, i can add an overflow, but it should not be too long,

asking this question because the right frame can be visible on a condition and cannot be

margin-left:5px;overflow-y: auto;overflow-x:hidden;height:700px;display: inline-block;

1 Answer 1

0

You can check the size of html elements with

$("selector").width()
$("selector").height()

you can just use those function , after all rendering is finished (the page must be loaded first).

At the bottom of the frame(s)

<script>
$(function(){
if(document.body.offsetWidth<$("selector").width()){
....
}else{
....
}
});
</script>
</body>
5
  • how can i implement that in a din so it happens with a div width management
    – chacha
    Commented Jun 10, 2020 at 18:52
  • i mean DIV so ican whre i can add it
    – chacha
    Commented Jun 10, 2020 at 19:04
  • that is strange, write a plugin
    – chacha
    Commented Jun 10, 2020 at 19:17
  • as you are using iframes, you the the calculations after page loads.
    – murat aka
    Commented Jun 10, 2020 at 19:31
  • within iframe , window.parent accesses the page which includes the iframe. you can call a function to modify iframes in .... part of the code. hope this helps.
    – murat aka
    Commented Jun 10, 2020 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.