Copy code The code is as follows: .org/1999/xhtml" > jQuery's position function (offset(), innerWidth(), innerHeight(), outerWidth(), outerHeight(), scrollTop( ), scrollLeft()) small application <br>#divShow{width:100px;height:50px;background-color:Green;display: none;} <br>#divAd{width:100px;height:100px;background-color:Red;position:absolute;top:100px;left:100px;} <br> <br>//in A div is displayed below the text box, similar to a calendar control. <br>function showDiv(obj){ <br>jQuery("#divShow").css("left",jQuery(obj).offset().left); <br>jQuery("#divShow").css ("top",jQuery(obj).offset().top jQuery(obj).outerHeight()); <br><br>jQuery("#divShow").show(); <br>} <br> jQuery(function(){ <br><br>}); <br>//The scroll bar scrolls and executes the following function, suitable for floating ads <br>jQuery(this).scroll(function(){ <br> jQuery("#divAd").css("top",100 jQuery(document).scrollTop()); <br>jQuery("#divAd").css("left",100 jQuery(document).scrollLeft( )); <br>}); <br> 2010-03-22 floating ad div> Used to support the scroll bar