jQuery Animate向左滑动 [英] jQuery Animate Slide Left
问题描述
我正在尝试使用带有缓动插件的jQuery动画向左滑动图像,但它似乎并不想工作.
I am trying to slide an image left using jquery animate with the easing plugin and it doesn't seem to want to work.
我有一个ID = 1和以下javascript的图片
I have an image with the id=1 and the following javascript
$(document).ready(function() {
$('#center-photo img:first').show();
$('#next').click(function() {
var active = $('#center-photo img:first');
//Slider Animation
$('#1')
.animate(
{ left: 200 }, {
duration: 'slow',
easing: 'easeOutBounce'
})
.animate(
{ left: 0 }, {
duration: 'slow',
easing: 'easeOutBounce'
});
});
});
下一个是我点击做动画的链接.
推荐答案
第
什么是ID属性的有效值? HTML?
ID不能以数字开头
它将搞砸验证,并弄乱浏览器解析html的方式
What are valid values for the id attribute in HTML?
ID's CANNOT START WITH A DIGIT
It will screw up validation as well as mess with the way browsers parse your html
第二 ID为1的图片的位置是什么?
Second What is the position of your image with the id of 1.
元素定位的一个常见问题通常是默认设置为静态时,尝试将位置更改为相对或绝对.
A common problem with element positioning is normally when it is defaulted to static try changing the position to relative or absolute.
这篇关于jQuery Animate向左滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!