Hi all,
I'm in the process of migrating a site from 1.2.7 to 1.3.2.

So far, I just ran into a bug in webkit browsers that forced me to rewrite
"expr1, expr2, ... exprN" selectors into loops (I suppose you're aware of
this one).
I also have trouble with attaching event handlers to dynamically created
elements, but I guess it's all a question of timing (and probably the
correct spot to look into $.live() ).

Anyway, I had some simple code to get the position for a div to appear at
the center of the viewport:

    getCenterPosition: function(targetWidth,targetHeight) {
      var win = $(window);
      var target = {
        top: Math.round((win.height()-targetHeight)/2)+win.scrollTop(),
        left: Math.round((win.width()-targetWidth)/2)+win.scrollLeft()
      }
      if (target.top<0) target.top = 0;
      if (target.left<0) target.left = 0;
      return target;
    },

It was cross-browser and quite simple indeed.

Problem is, in 1.3.2, windows dimensions are those of the whole body, not
just the viewport. I turned the code upside/down but just can't find the
proper mean to do the exact same thing with the changes that probably
occured at 1.3.0.

Since you all know the internals of jQuery, I guess this is as good a place
to ask for ideas or pointers.

Take care all,

-- Julian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to