I have the following code so far but not sure how I can use jquery slide effect on an image I'm loading in a <div>
.
.js I have loaded so far
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="jqueryui.js"></script>
The HTML code is
<div align="center"><img src="images/personal_photo.png" width="900" height="850" alt="Awesome effects"></div>
Note: Since I dont know how to apply the jquery-ui effects I have not done anything with the code.
The jQuery slideToggle() method toggles between the slideDown() and slideUp() methods. If the elements have been slid down, slideToggle() will slide them up. If the elements have been slid up, slideToggle() will slide them down. $(selector). slideToggle(speed,callback);
jQuery slideToggle() Method The slideToggle() method toggles between slideUp() and slideDown() for the selected elements. This method checks the selected elements for visibility. slideDown() is run if an element is hidden. slideUp() is run if an element is visible - This creates a toggle effect.
The task here is to create a slide left and right toggle effect in the JQuery, you can use the jQuery animate() method. . animate() method: It is used to change the CSS property to create the animated effect for the selected element.
If you want to show the object and you want the slide towards the left, then you have to reverse the direction of the slide.
something like the following:
$("img").click(function () {
$(this).show("slide", { direction: "right" }, 1000);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With