Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#slider_bx').bxSlider({
- mode: 'fade',
- speed: 1000,
- pause: 9000,
- auto: true,
- autoControls: false,
- prevText: '',
- nextText: '',
- autoHover: true,
- captions: false,
- pager: true,
- onBeforeSlide: function () {
- if ($('.slide_in').length) {
- $('.slide_in').hide();
- }
- },
- onAfterSlide: function () {
- if ($('.slide_in').length && $('.slide_in').is(':hidden')) {
- doCrazyStuff();
- }
- }
- });
- function doCrazyStuff() {
- var $this = $('.slide_in');
- if ($this.length > 0) {
- setTimeout(function () {
- $this.show();
- $this.rotate({
- duration: 2000,
- angle: 90,
- animateTo: -20
- });
- }, 3000);
- }
- }
- $this.show().stop();
- $this.stop().show();
- $this.stop().rotate({
- duration: 2000,
- angle: 90,
- animateTo: -20
- });
- $this.rotate({
- duration: 2000,
- angle: 90,
- animateTo: -20
- }).stop(); // throws an error
- var crazyTimeout;
- function doCrazyStuff() {
- var $this = $('.slide_in');
- if ($this.length > 0) {
- if (crazyTimeout != undefined) {
- clearTimeout(crazyTimeout); // Cancel previous timeout
- }
- crazyTimeout = setTimeout(function () {
- crazyTimeout = undefined;
- $this.show();
- $this.rotate({
- duration: 2000,
- angle: 90,
- animateTo: -20
- });
- }, 3000);
- }
- }
- var crazyTimeout;
- function doCrazyStuff() {
- var $this = $('.slide_in');
- if ($this.length > 0) {
- if (crazyTimeout != undefined) {
- return; // A timeout is still running: don't create new one
- }
- crazyTimeout = setTimeout(function () {
- crazyTimeout = undefined;
- $this.show();
- $this.rotate({
- duration: 2000,
- angle: 90,
- animateTo: -20
- });
- }, 3000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement