admin管理员组

文章数量:1023025

I need to whole body mouseover function. When I enter some other page, some of my content will append the particular div.

My code is:

$('body').mouseover(function() {
  $('#text').append('<div>New content</div>');
});

I need to whole body mouseover function. When I enter some other page, some of my content will append the particular div.

My code is:

$('body').mouseover(function() {
  $('#text').append('<div>New content</div>');
});
Share Improve this question edited Jul 21, 2011 at 9:13 pimvdb 155k80 gold badges311 silver badges356 bronze badges asked Jul 21, 2011 at 9:11 user844589user844589 1
  • 2 This works for me, what's the problem? – marto Commented Jul 21, 2011 at 9:18
Add a ment  | 

1 Answer 1

Reset to default 4

The body will not always have its full potential height if the contents fit in a lower height.

You could use $('html').mouseover instead: http://jsfiddle/mPdd7/.

I need to whole body mouseover function. When I enter some other page, some of my content will append the particular div.

My code is:

$('body').mouseover(function() {
  $('#text').append('<div>New content</div>');
});

I need to whole body mouseover function. When I enter some other page, some of my content will append the particular div.

My code is:

$('body').mouseover(function() {
  $('#text').append('<div>New content</div>');
});
Share Improve this question edited Jul 21, 2011 at 9:13 pimvdb 155k80 gold badges311 silver badges356 bronze badges asked Jul 21, 2011 at 9:11 user844589user844589 1
  • 2 This works for me, what's the problem? – marto Commented Jul 21, 2011 at 9:18
Add a ment  | 

1 Answer 1

Reset to default 4

The body will not always have its full potential height if the contents fit in a lower height.

You could use $('html').mouseover instead: http://jsfiddle/mPdd7/.

本文标签: javascriptNeed whole body tag mouseover functionStack Overflow