To get screen resolution in JS use screen
object
screen.height;
screen.width;
Based on that values you can calculate your margin to whatever suits you.
More Related Contents:
- Jquery Change Height based on Browser Size/Resize
- Disable zooming of the page in desktop web browsers using Javascript/Jquery [duplicate]
- Change Height based on Browser Size/Resize
- jQuery append function is just appending the html but not the classes related to it
- Updating php values using jquery
- Jquery replace only specific characters [closed]
- Regex for Email Address along with name format [duplicate]
- Display attribute ‘Title’ of element/s in other element on Focus or Click
- window.onload vs $(document).ready()
- What’s the best way to detect a ‘touch screen’ device using JavaScript?
- How to delay the .keyup() handler until the user stops typing?
- Is there a null-coalescing (Elvis) operator or safe navigation operator in javascript?
- Remove ALL white spaces from text
- Converting milliseconds to a date (jQuery/JavaScript)
- Format a number as 2.5K if a thousand or more, otherwise 900
- check if jquery has been loaded, then load it if false
- Check if option is selected with jQuery, if not select a default
- Export to csv in jQuery
- How can I listen for a click-and-hold in jQuery?
- How to scroll the window using JQuery $.scrollTo() function
- How to get the number of lines in a textarea?
- Convert numbers to letters beyond the 26 character alphabet
- jQuery – select all text from a textarea
- Moving a focus when the input text field reaches a max length
- How to download PDF automatically using js?
- Web browser: Hide mouse cursor [duplicate]
- Jquery click function is not working for dynamic elements
- fadeOut() and slideUp() at the same time?
- How to check if the user is online using javascript or any library?
- Jquery change text between two elements