简体   繁体   中英

How to set the screen height and width by %(percentage) in javascript

i am using one plugin for slider. That slider contains H & W is mentioned by pixel. I want that in %

$("#section4").awShowcase(
    {
        content_width:          1000,
        content_height:         300,
}
});

They are mentioned by like this. how to change this by % - Percentage.

I want that for responsive model

$("#section4").awShowcase(
    {
        content_width:          100%,
        content_height:         30%,
  }
});

Is this what you looking for?

Try to use:

$("#section4").awShowcase({
    content_width: '50%',
    content_height: '50%',
//}  // Remove this
}); 

Also, you're having redundant } in your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM