Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. if ($slideNumber == 1) {
  2. $('#prev').attr("class", "not_active")
  3. $('#next').attr("class", "active")
  4. }
  5. else if ($slideNumber == divSum) {
  6. $('#next').attr("class", "not_active");
  7. $('#prev').attr("class", "active");
  8. }
  9. else {
  10. $('#prev').attr("class", "active")
  11. $('#next').attr("class", "active")
  12. };
  13.  
  14. function setImageReelWidth () {
  15. //Get size of images, how many there are, then determin the size of the image reel.
  16. var divWidth = $(".window").width();
  17. var divSum = $(".slide").size();
  18. var divReelWidth = divWidth * divSum;
  19.  
  20. //Adjust the image reel to its new size
  21. $(".image_reel").css({ 'width': divReelWidth });
  22. }
  23.  
  24. // I like the more succinct:
  25. $(handler)
  26. // Instead of:
  27. $(document).ready(handler)
  28.  
  29. function testFunction () {
  30. alert ('it works');
  31. }
  32. $(document).ready(function () {
  33. testFunction();
  34.  
  35. // ... other code
  36. });
  37.  
  38. if ($slideNumber == 1) {
  39. $('#prev').attr("class", "not_active")
  40. $('#next').attr("class", "active")
  41. }
  42. else if ($slideNumber == divSum) {
  43. $('#next').attr("class", "not_active");
  44. $('#prev').attr("class", "active");
  45. }
  46. else {
  47. $('#prev').attr("class", "active")
  48. $('#next').attr("class", "active")
  49. };
  50.  
  51. $('#prev').attr("class", "not_active")
  52. $('#next').attr("class", "not_active")
  53. if ($slideNumber > 1)
  54. $('#prev').attr("class", "active")
  55. if ($slideNumber < divSum )
  56. $('#next').attr("class", "active")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement