css - Execute function on class when load and resize (Jquery) -


I have a problem with the following function. It is crazy that for all parents, with the "center_vert" class, all divs are to be centered in the center when the page is full, then the center with vertical "center_vert" is vertically centered only in the first div. When I change the size of the page all the elements are centered. Why are not all divs with the "center_vert" class centered on the load?

  $ (document) .load ($ (window) .bind ("resize", centerVertically)); $ (Document) .ready (centerVertically ()); Function Center (especially) ($ {'(center_vert'). Each (function () {var parentHeight = $ (this) .Parent () height (); var selfHeight = $ (this) .height (); $ (this) .css ('padding-top', function , X) {returns ((parentheit-swight) / 2);});}); }; Remove empty space near the function name.    

You should get an error in your browser console related to this error.

  $ (document) .ready (centerVertically ());    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -