Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. var flag=0;
  2. jssor_1_slider_init = function() {
  3.  
  4. var jssor_1_options = {
  5. $AutoPlay: 0,
  6. $DragOrientation: 2,
  7. $PlayOrientation: 2,
  8. $FillMode: 2,
  9. $Loop: 0,
  10. $SlideWidth: 375,
  11. $BulletNavigatorOptions: {
  12. $Class: $JssorBulletNavigator$,
  13. $Orientation: 2
  14. }
  15. };
  16.  
  17. var jssor_1_slider = new $JssorSlider$("jssor_1", jssor_1_options);
  18. //////////////////////trying to get append next slide/////////////////////////////
  19. function DisplayIndex(position, virtualPosition) {
  20. console.log("---------------");
  21. if(flag==0){
  22. flag=1;
  23. previous_position = parseInt(virtualPosition)+1;
  24. }
  25. else {
  26. var total_slides = jssor_1_slider.$SlidesCount();
  27. var current_slide = parseInt(virtualPosition)+1;
  28. if(previous_position==current_slide){
  29. console.log("do nothing");
  30. }
  31. if(previous_position>current_slide){
  32. console.log("previous");
  33. }
  34. if(previous_position<current_slide){
  35. console.log("next");
  36. var slidesHtml='<div><img data-u="image" src="img/010.jpg" /></div>';
  37. jssor_1_slider.$AppendSlides(slidesHtml, total_slides);
  38. jssor_1_slider.$GoTo(position);
  39. }
  40. previous_position = current_slide;
  41. }
  42. }
  43. jssor_1_slider.$On($JssorSlider$.$EVT_SWIPE_END, DisplayIndex);//$EVT_DRAG_END
  44. //////////////////////trying to get append next slide ends/////////////////////////////
  45. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement