[jQuery] Re: Hover does not stop

2009-09-03 Thread Mario

Now it works fine!

Thanks a lot to all for your help!


$(function(){

var state = 0;

$('#navigation').mouseover(
function() { if(state == 0) {$(this).animate({left: '0'},
'slow'); state = 1;}}
);

$('#navigation').mouseout(
function() {if(state == 1) {$(this).animate({left:
'-210'},'slow', function(){state = 0;});}}
);

});


[jQuery] Re: Hover does not stop

2009-09-01 Thread Mario

ok, i tried this and this works fairly. but another question is:
can i change the state AFTER the animate() is finished?
(there are still some problem when i touch certain points while
sliding)


$(function(){

var state = 0;

$('#navigation').mouseover(
function() { if(state == 0) {$(this).animate({left: '0'},
'slow'); state = 1;}}
);

$('#navigation').mouseout(
function() { if(state == 1) {$(this).animate({left: '-210'},
'slow'); state = 0;}}
);

});


[jQuery] Re: Hover does not stop

2009-09-01 Thread amuhlou

Looking at the API the animate does have a callback function that you
can use to do the stuff after the animation completes, for example

$('#navigation').mouseout(
function() {
  if(state == 1) {
$(this).animate({left: '-210'},'slow',
'easein',function(){
  //do stuff after animate finishes here
  });
state = 0;
   }
 }
);

http://docs.jquery.com/Effects/animate


On Sep 1, 11:22 am, Mario sevenartwo...@googlemail.com wrote:
 ok, i tried this and this works fairly. but another question is:
 can i change the state AFTER the animate() is finished?
 (there are still some problem when i touch certain points while
 sliding)

 $(function(){

         var state = 0;

         $('#navigation').mouseover(
         function() { if(state == 0) {$(this).animate({left: '0'},
 'slow'); state = 1;}}
     );

         $('#navigation').mouseout(
         function() { if(state == 1) {$(this).animate({left: '-210'},
 'slow'); state = 0;}}
     );

 });


[jQuery] Re: Hover does not stop

2009-08-28 Thread Mario

Toggle works fine. But the problem now is that I always have to click
and I wanted the menu ot appear and disappear onmouseover/mouseout.


[jQuery] Re: Hover does not stop

2009-08-28 Thread Paolo Chiodi

maybe the hover is generated more than once while it is sliding.
I would try to add a callback on animation end, setting tha state of
the menu: open or closed.
then on mouse over animate only if open, on mouse out close only if closed

On Fri, Aug 28, 2009 at 12:01 PM, Mariosevenartwo...@googlemail.com wrote:

 Toggle works fine. But the problem now is that I always have to click
 and I wanted the menu ot appear and disappear onmouseover/mouseout.


[jQuery] Re: Hover does not stop

2009-08-28 Thread rupak mandal
hi, what I have getting is that hover function is call multiple time till
the mouse pointer is inside the div area. May be you try onmouseover and
onmouseout. As suggested by paolo.

On Fri, Aug 28, 2009 at 4:36 PM, Paolo Chiodi chiod...@gmail.com wrote:


 maybe the hover is generated more than once while it is sliding.
 I would try to add a callback on animation end, setting tha state of
 the menu: open or closed.
 then on mouse over animate only if open, on mouse out close only if closed

 On Fri, Aug 28, 2009 at 12:01 PM, Mariosevenartwo...@googlemail.com
 wrote:
 
  Toggle works fine. But the problem now is that I always have to click
  and I wanted the menu ot appear and disappear onmouseover/mouseout.



[jQuery] Re: Hover does not stop

2009-08-28 Thread rupak mandal
Try this

$(function(){
$('#navigation').hover(
function() { $(this).stop().animate({left: '-210'}, 'slow');},
function() { $(this).stop().animate({left: '0'}, 'slow');}
);

});

I think that's work

On Fri, Aug 28, 2009 at 5:50 PM, rupak mandal rupakn...@gmail.com wrote:

 hi, what I have getting is that hover function is call multiple time till
 the mouse pointer is inside the div area. May be you try onmouseover and
 onmouseout. As suggested by paolo.

 On Fri, Aug 28, 2009 at 4:36 PM, Paolo Chiodi chiod...@gmail.com wrote:


 maybe the hover is generated more than once while it is sliding.
 I would try to add a callback on animation end, setting tha state of
 the menu: open or closed.
 then on mouse over animate only if open, on mouse out close only if closed

 On Fri, Aug 28, 2009 at 12:01 PM, Mariosevenartwo...@googlemail.com
 wrote:
 
  Toggle works fine. But the problem now is that I always have to click
  and I wanted the menu ot appear and disappear onmouseover/mouseout.





[jQuery] Re: Hover does not stop

2009-08-27 Thread amuhlou

in CSS, try adding position: relative; to the #navigation properties

On Aug 27, 7:12 pm, Mario sevenartwo...@googlemail.com wrote:
 Hello everybody,

 I want to create a menu on the left side of the screen. OnMouseOver
 the menu should slid in from the left, OnMouseOut the menu should
 slide back to the right so that only 30px are still visible. I tried
 something but actually I cannot control it because it doesn't stop
 sliding:

 http://www.ulmercampus.de/try

 Here is the source:

 $(function(){

         $('#navigation').hover(
                 function() { $(this).animate({left: '-210'}, 'slow');},
                 function() { $(this).animate({left: '0'}, 'slow');}
         );

 });

 And here the XHTML:
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

 html xmlns=http://www.w3.org/1999/xhtml;

 head
 title| Hallo Welt|/title

 meta http-equiv=Content-Type content=text/html; charset=utf-8/
 meta name=identifier-url content=www.ulmercampus.de /
 meta name=author content=sevenartworks.com /
 meta name=description content= /
 meta name=keywords lang=de content= /
 meta name=keywords lang=en-us content= /
 meta name=keywords lang=en content= /
 meta name=keywords lang=fr content= /
 meta name=robots content=index /

 meta name=robots content=nofollow /
 meta name=revisit-after content=10days /
 meta name=audience content=all /
 meta name=seite-topic content= /
 meta name=seite-type content=portal /
 meta http-equiv=content-language content=de /
 meta http-equiv=imagetoolbar content=no /

 script src=./module/jquery.js type=text/javascript/script
 script src=./module/javascripts.js type=text/javascript/
 script

 link rel=stylesheet href=./stylesheets/reset.css type=text/css /

 link rel=stylesheet href=./stylesheets/stylesheet.css type=text/
 css /
 /head

 body
 div id=navigation
         Hallo Welt

 /div

 /body
 /html


[jQuery] Re: Hover does not stop

2009-08-27 Thread amuhlou

can you post an example page? it's hard to visualize what's going
wrong without seeing it in action.

thanks

On Aug 27, 8:07 pm, Mario sevenartwo...@googlemail.com wrote:
 This works a little bit better, however, it slides still one more than
 I want and I cannot access the Menu because it starts to move left
 immediately.


[jQuery] Re: Hover does not stop

2009-08-27 Thread Mario

This works a little bit better, however, it slides still one more than
I want and I cannot access the Menu because it starts to move left
immediately.


[jQuery] Re: Hover does not stop

2009-08-27 Thread Mario

Yes, here it is:
http://www.ulmercampus.de/try

This has position:absolute, but position:relative works similar as
mentioned.


[jQuery] Re: Hover does not stop

2009-08-27 Thread marksimon

Have you tried replacing hover with toggle? The hover seems to just go
nuts for that usage.

On Aug 27, 1:38 pm, Mario sevenartwo...@googlemail.com wrote:
 Yes, here it is:http://www.ulmercampus.de/try

 This has position:absolute, but position:relative works similar as
 mentioned.