tdorr07
tdorr07

Reputation: 1

Image jQuery Sliding not working

I'm trying to make an image slidein on page load but it doesn't seem to work at all. The delay has no problem but the sliding effect doesn't do anything. Any help would be greatly appreciated.

$(function() {
 $(".bgslide").one('load', function () {
  $(this).delay(1000).show("slide", { direction: "left" }, 'linear', 2000);
  }).each(function() {
  if(this.complete) jQuery(this).load();
 });
});

Here is a link to a jsfiddle as well: http://jsfiddle.net/cDYvh/

Upvotes: 0

Views: 48

Answers (2)

ZekeTheGeek
ZekeTheGeek

Reputation: 93

You could also use $.animate() to avoid including jQuery UI. For example, you could accomplish your example with something like this:

$(this).animate({ left: 2000px });

Note: You'll probably need to apply position:absolute to the elements. Other items can be animated as well, including color, opacity, etc.

Animate Example

Upvotes: 0

elclanrs
elclanrs

Reputation: 94101

The slide effect comes with jQuery UI which you didn't include: http://jsfiddle.net/cDYvh/1/

Upvotes: 2

Related Questions