[b]小数转化为百分数并能四舍五入[/b]:(n*100).toFixed(2)+"%"
[b]jquery选择器[/b]:$("a[name='calculte']").click(function(e){……}
[b]jquery修改元素样式:[/b]$("#p").css({'top':top+wtop-e.clientY-eight,'left':left+73});
[b]关于位置:[/b]
$(document).height()、$(document).width():html文档的高度和宽度,跟页面长短有关。
$(window).height()、$(window).width():窗口的高度和宽度,跟浏览器的大小有关。
$(this).offset().top、$(this).offset().left:元素在当前视口的相对文档(document)的偏移。
e.clientX、e.clientY:鼠标指针相对窗口(window)的偏移。
[b]jquery选择器[/b]:$("a[name='calculte']").click(function(e){……}
[b]jquery修改元素样式:[/b]$("#p").css({'top':top+wtop-e.clientY-eight,'left':left+73});
[b]关于位置:[/b]
$(document).height()、$(document).width():html文档的高度和宽度,跟页面长短有关。
$(window).height()、$(window).width():窗口的高度和宽度,跟浏览器的大小有关。
$(this).offset().top、$(this).offset().left:元素在当前视口的相对文档(document)的偏移。
e.clientX、e.clientY:鼠标指针相对窗口(window)的偏移。