Animate content of jQuery Cycle slides

点点圈 提交于 2019-12-06 11:51:43

This would actually work a little bit better.

function onBefore(cycle) {        
  $(this).children("section.text").delay(300).animate({marginLeft:"35%"}, 1500);
};

function onAfter(cycle) {        
  $(this).children("section.text").delay(1300).animate({marginLeft:"-1400px"}, 1400);
};

The best way to do this is to create your own transition and to animate the title as a part of it. It does require a little more work than using the onAfter and onBefore which won't work for you in this case.

Here is an example that should help get you started: http://return-true.com/2012/03/creating-a-custom-caption-transition-for-jquery-cycle/

A couple of months late, but hopefully this might help others:

You can use the current element to find its proper children

function onAfter(cycle) {        
  $(this).children(".slideTitle").delay(200).animate({marginLeft:"10px"}, 200);
};

function onBefore(cycle) {        
  $(this).children(".slideTitle").css("marginLeft", "-400px");
};
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!