I am creating a DIV status using the jQuery In addition, it is important that this element is still visible if Javascript is disabled. You can access your offset () function. In order to avoid having a DIV flash in the wrong position, I am hiding the div before the situation and then showing the DIV again. However, there is a synchronization problem and I can still see the flash on some platforms (like an iPhone). What is the best way to emulate the callback function for the
offset () function?
$ ('div'). Hide (); Y = Math (($ (Window). Light () - $ ('div'). Outer hat ()) / 2); $ ('Div') offset ({top: y}); $ ('Div') fadein () .; Besides, Edit
& lt; Div & gt; The element can out-out from the viewport outside the viewport, then before proceeding to hide it again and set it offset and fade it off:
CSS:
.outout-viewport {status: absolute; Left: -10000 pixels; }
javascript:
var $ div = $ ("div.outside-viewport"); $ DivCss ({status: "relative", left: "0px"}). Hide (). Offset ({top: ($ (window) .hit () - $ div.outerHeight ()) / 2}). Fade ();
Comments
Post a Comment