Advertisement
vitareinforce

nested checking background

Dec 14th, 2022
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. img_berita.src = '/img/{{ $home->berita_background }}';
  2. img_berita.onload = function() {
  3. agenda_position_y = berita_position_y + (((screen.width / this.width) * this.height) - gap);
  4. img_agenda.src = '/img/{{ $home->agenda_background }}';
  5. img_agenda.onload = function() {
  6. sejarah_position_y = agenda_position_y + (((screen.width / this.width) * this.height) - gap);
  7. img_sejarah.src = '/img/{{ $home->sejarah_background }}';
  8. img_sejarah.onload = function() {
  9. tentang_position_y = sejarah_position_y + (((screen.width / this.width) * this.height) - gap);
  10. img_tentang.src = '/img/{{ $home->tentangkami_background }}';
  11. img_tentang.onload = function() {
  12. berita_position_y2 = tentang_position_y + (((screen.width / this.width) * this.height) - gap);
  13. img_berita2.src = '/img/{{ $home->berita_background }}';
  14. img_berita2.onload = function() {
  15. agenda_position_y2 = berita_position_y2 + (((screen.width / this.width) * this.height) - gap);
  16. img_agenda2.src = '/img/{{ $home->agenda_background }}';
  17. img_agenda2.onload = function() {
  18. sejarah_position_y2 = agenda_position_y2 + (((screen.width / this.width) * this.height) - gap);
  19. img_sejarah2.src = '/img/{{ $home->sejarah_background }}';
  20. img_sejarah2.onload = function() {
  21. tentang_position_y2 = sejarah_position_y2 + (((screen.width / this.width) * this.height) - gap);
  22. img_tentang2.src = '/img/{{ $home->tentangkami_background }}';
  23. img_tentang2.onload = function() {
  24. $('#konten').css({
  25. 'background-image': 'url("' + img_berita.src + '"), url("' + img_agenda.src + '"), url("' + img_sejarah.src + '"), url("' + img_tentang.src + '"), url("' + img_berita2.src + '"), url("' + img_agenda2.src + '"), url("' + img_sejarah2.src + '"), url("' + img_tentang2.src + '")',
  26. 'background-position-x': '0px, 0px, 0px, 0px',
  27. 'background-position-y': berita_position_y + 'px, ' + agenda_position_y + 'px, ' + sejarah_position_y + 'px, ' + tentang_position_y + 'px, ' + berita_position_y2 + 'px, ' + agenda_position_y2 + 'px, ' + sejarah_position_y2 + 'px, ' + tentang_position_y2 + 'px',
  28. 'background-repeat': 'no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat',
  29. 'background-size': 'contain, contain, contain, contain, contain, contain, contain, contain'
  30. });
  31. };
  32. };
  33. };
  34. };
  35. };
  36. };
  37. };
  38. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement