jquery windows resize 定位指定元素 改变窗口大小

jQuery.noConflict(); jQuery(document).ready(showNavigationHr); jQuery(window).resize(showNavigationHr); function showNavigationHr() { var to = jQuery("#navhr"); var source = getSelectedNavigation(); if(source==null) return null; var width = source.width(); var top = source.offset().top; var left = source.offset().left; try { to.width(width); var fixTop = 50; to.css("top", top+fixTop); to.css("left", left); } catch(err) { } function getSelectedNavigation() { var __tabindex = jQuery("#tabindex").html(); if(__tabindex == "") __tabindex ="family_register"; return jQuery("#"+__tabindex); } //for mainws resize to adapt var resizewidth = jQuery("#rightDiv").width() - jQuery("#vmenu").width() - 105; jQuery("#mainws").width(resizewidth); }

你可能感兴趣的:(jquery,windows,function,null)