SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Sep 2005
    Georgia, US
    0 Post(s)
    0 Thread(s)

    MouseOver question

    Hey there. I started diving into the scriptaculous library this week and I'm kinda stuck with something I'd like to do. I am trying to keep my markup as clean as possible and keep my javascript external. I'm loading the scriptaculous scripts and also one I'm messing around with. The example page is found here and the javascript is below:
    Event.observe(window, 'load', function() {
    	var y = 3;  // The nunmber of DIVS to do this to
    	for(i = 1; i <= y; i++){
    		var elem=document.getElementById("more" + i);
    		new Effect.toggle(elem, 'ideal', {delay: 1, duration: .7});
    	var cli = document.getElementById("lorem1");
    	cli.onclick = function () { new Effect.toggle("more1", 'ideal', {duration: .5}) };	
    	var cli2 = document.getElementById("lorem2");
    	cli2.onclick = function () { new Effect.toggle("more2", 'ideal', {duration: .5}) };
    I actually have multiple questions for my entire goal but I'll approach them one at a time. I've noticed that the onMouseOver event is triggered every time the mouse it re-located to any given coordinate within my object. Therefore triggering my function with any movement (example is my 3rd DIV in the link above). Is there a way for me to do a true mouse over that will trigger my function only once even if the mouse is moved over my object? I read about onMouseEnter for IE but obviously I'm trying to satisfy all browsers. Any help is appreciated. Thanks!
    Last edited by erguitar; Aug 24, 2007 at 18:55.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts