Questions tagged [outerwidth]

19 questions
13
votes
3 answers

jQuery 1.8.2 + noncurrent jQuery UI = outerWidth and outerHeight broken

This is a re-do of a question that was closed erroneously: jQuery 1.8 outer Height/Width not working I'm hitting the same issue. outerWidth and outerHeight and now returning the jQuery object instead of numbers. We are using jQuery UI 1.8.17,…
Andy Ray
  • 30,372
  • 14
  • 101
  • 138
3
votes
1 answer

Unexpected behavior when trying to center element of dynamic width horizontally using outerWidth() and $(window).resize()

Edit 1 (reduced the problem to a jsfiddle): I removed some unnecessary detail of the original problem. I am trying to center a popup in the window. Because of how it will be used in the original context, the popup's width will be dynamic. Its only…
dnag
  • 335
  • 1
  • 9
3
votes
1 answer

wrong width calculation using outerWidth() in google chrome [onload]

I have a navigation bar(topmenu) inside a div. I have to hide the rest of the menu elements if the width of the menu is greater than that of the outer div. Unfortunately I cant use overflow:hidden for the div .So I use .outerWidth() function to…
arjuncc
  • 3,227
  • 5
  • 42
  • 77
2
votes
1 answer

Centering elements with margin/padding using .outerWidth()/.outerHeight(). Function returns different values for margin and padding

i am attempting to center elements both laterally and vertically in their parent elements by calculating the difference in width and height of parent and child element and the using difference as either margin or padding. I am calculating the…
Frederick M. Rogers
  • 841
  • 4
  • 14
  • 37
2
votes
1 answer

Apply the following formatting unless the viewport is smaller than the container div - Jquery

I am trying to create the following in Jquery, what I am trying to do is apply formatting to a div ONLY if the viewport is BIGGER than the .container div. I have written the following but I am not sure if I have done it correctly as my Jquery isn't…
Iain Simpson
  • 8,011
  • 13
  • 47
  • 66
1
vote
0 answers

Width issue in browser resize

I have li elements with position:absolute and i position them using transform:translate() by javascript. I need to reposition them when the browser window is resized , it works fine but when li width changes between 50% and 25% in media query , the…
Code-Lover
  • 299
  • 1
  • 14
1
vote
4 answers

jQuery wrong outerWidth() and outerHeight() after resize()

HTML

I want to center this element vertically and horizontally.

CSS .element { background: #eee; border: 1px solid #ccc; font-size: 24px; margin: 10px; padding: 20px; position:…
user557108
  • 1,195
  • 3
  • 17
  • 26
0
votes
1 answer

width , innerwidth , outwerwidth, all returns higher value than actual

On the page: http://local.finerock.com/engagement-rings/halo-engagement-rings.html I am using flexbox to display product filters, and used a small jquery to set child element width equal to its sibling, the code is like: $(window).load(function(){ …
0
votes
1 answer

jQuery element outerWidth() returns 0

I have a image element with css set height: 64px; width: auto; When i try to get height and width through jQuery using .outerHeight() & .outerWidth(), i can get height correctly but width returns as 0. I have even tried width(), innerWidth() still…
Abdul Pathan
  • 345
  • 3
  • 12
0
votes
1 answer

Outerwidth() function returns 0, when using for siblings

I have 4 different div with image thumbnails. For thumbnail click I have created a jQuery script to enlarge the image. Enlarge image works for the first page #C1, but remaining pages, the outerWidth is returning 0. Hence the Enlarge image is not…
Usha
  • 1
0
votes
1 answer

jQuery - why each can't get the width of hidden elements?

Why each can't get the width of hidden elements? My code: .hidden { display: none; }
Run
  • 54,938
  • 169
  • 450
  • 748
0
votes
2 answers

jquery window width not working at some breakpoints

I wrote a script that loads some html from files based on the width of window. The problem is that at some points it fails to work var winWidth = $(window).width(); //var winWidth = window.outerWidth; //var winWidth = document.body.offsetWidth; …
Stacy J
  • 2,721
  • 15
  • 58
  • 92
0
votes
0 answers

IE11 javascript window.outerWidth returns undefined

Google searching says window.outerWidth and window.outerHeight will return the outer dimensions of the current window. However, my HTA file opening in IE11 gives "undefined" for these properties. What am I doing wrong?
0
votes
2 answers

convert javascript to jquery .width

I'm using this script to load small or large images depending on the screen width.