title: Jquery mouseenter triggers on load
body: <p>I want an event to trigger when I hover my mouse over an object.
  When I try to use jquery's mouseuner or mouseover the event triggers once when the page loads, and does not trigger when I hover over the image or imagebox</p>
  
  <p>My code is below. I really don't understand what's happening.
  Thank you.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script src="jquery-1.9.1.min.js"&gt;
          &lt;/script&gt;
          &lt;script&gt;
              var img = '';
              var offset_const = 0.03;
  
              var timer = '';
  
              $(document).ready(function(){
  
              function init(obj, image, psize){
                  var height = obj.height();
                  //obj.height(1000);
                  var imageId = 'vtourImg';
  
                  img = $('&lt;img id="'+ imageId +'"&gt;');
                  img.attr('src', image);
                  img.attr('height', height);
                  obj.append(img);
  
                  //$(obj).mouseenter(function(e){setInterval(function(e){scroller(e);}, 1000);});
              }
  
              function scroller(e){
                  //setTimeout(scroller(e), 10000);
                  var x = e.pageX - this.offsetLeft;
                  var y = e.pageY - this.offsetTop;
                  var midX = $(this).width() / 2;
  
                  var current_offsetX = img.offset().left;
                  var offsetX_add = offset_const * -1 * (x - midX);
                  var offsetX = 0;
  
                  offsetX = current_offsetX + offsetX_add;
  
                  img.offset({left: offsetX });
              }
  
                  init($('#vtour'), 'virtualtour4.jpg', 0.00);
                  img.mouseenter(alert('test'));
              });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div id="vtour" style="width:500px;height:500px;border:3px black solid;overflow:hidden;"&gt;&lt;/div&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>