0

I'm not using jquery UI but i would like to make element slide and show at same time, from left to right.

So which is the equivalent function of jquery UI?:

$(function(){
$(element).show('slide', {direction: 'right'},1000);
});

thanks

10
  • 4
    you can use .animate too Commented Mar 19, 2013 at 11:46
  • @DipeshParmar how to dude? pls Commented Mar 19, 2013 at 11:47
  • 1
    Example : $(element).animate({left: '300px'}, 1000); Commented Mar 19, 2013 at 11:50
  • thx, but animate doesn't shows pfff Commented Mar 19, 2013 at 11:56
  • 1
    Will this work if the element is hidden to start with? Commented Mar 19, 2013 at 11:56

3 Answers 3

1

As @DipeshParmar has commented, you can use .animate() to slide an element.

$(".box").animate({left: "200px", opacity: 1}, 4000);  

Live Demo: http://jsfiddle.net/zq6Rx/6/

Sign up to request clarification or add additional context in comments.

Comments

1

try this

$(element).hide().animate({width: 'toggle'});

fiddle here

3 Comments

then hide() it first and then animate.. :)
If it's already hidden, do you need the .hide() call first? jsfiddle.net/zq6Rx/5
no.. if its hidden then works fine.. :).. no need to hide.. toggle just checks if the element is hidden or not,if hidden it shows and if not it hides... :) :)
1

You can use opacity css property for hidden field as you asked.

$("#element").animate( { "opacity": "show", left:"200px"} , 1000 );

OR

$("#element").animate( { "opacity": 1, left:"200px"} , 1000 );

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.