Thursday, 15 April 2010

Slide div left/right using jQuery -



Slide div left/right using jQuery -

i found next code in multiple places slide left/right:

$('#hello').hide('slide', {direction: 'left'}, 1000);

however, can't working. here minimalistic test trying:

<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function() { $("#test").click(function() { $('#hello').hide('slide', {direction: 'left'}, 1000); }); }); </script> </head> <body> <article > <div id="hello"> hello </div> <p><span id="test">test</span> </arcticle> </body>

i tried in chrome , safari , doesn't work.

what problem? there other working methods slide left/right?

$('#hello').hide('slide', {direction: 'left'}, 1000); requires jquery-ui library. see http://www.jqueryui.com

jquery

No comments:

Post a Comment