0

I have div.contentArea that contains some contents with scrollbar. It was defined that when the mouse enters div.content , return ID of the content and some more ajax action with this jQuery code:

$('.contentAarea').on('mouseenter','.content',function(){
    var getId = $(this).attr('id');
    alert(getId);
    // some more ajax actions.
}); 

for more details: http://jsfiddle.net/mr_mohsen_rasouli/4Nb9L/10/

now i define a div.mark element with fixed position and want when I scroll or up down and a div.mark enter the div.content , do action.

How can I do that?

gkaimakas
  • 574
  • 3
  • 17
Mohsen Rasouli
  • 352
  • 3
  • 9
  • 22

1 Answers1

0

You can do the following

on("mousenter",function(evt){ }

evt is an object that contains some very helpfull information about the position of the cursor. A very ineresting attribute is the currentTarget that contains the element the cursor is in, complete with class name and id.

Also you can use console.log to print messages in the console and avoid alerts

I don't quite understand what you want to do with that information because your english isn't very good but if you explain better I can help you.

gkaimakas
  • 574
  • 3
  • 17
  • I don't want to use mouse or mouse event. I wanna that when the `.mark` box go into the `.content` do some actions like alert! – Mohsen Rasouli Jul 05 '14 at 22:30
  • you should read this question http://stackoverflow.com/questions/683339/how-do-i-find-the-absolute-position-of-an-element-using-jquery – gkaimakas Jul 05 '14 at 22:37