1. $.ajax({url: "./=about-screen-contest/contest-for-10/json/", dataType:"json"}).done(function(json) {
  2. var container = $("#wrapper");
  3. var grid = $("<div />" ,{id:"grid"});
  4. grid.appendTo(container);
  5. for(var i = 0; i < json['object_list'].length; i++) {
  6. var item = json['object_list'][i];
  7. //if (item.verified) {
  8. var downloadimage = $('<img data-number="'+i+'">');
  9. downloadimage.on("load", function () {
  10. var item = json['object_list'][$(this).data("number")];
  11. grid.append('<div><image class="contest" data-date="' + item.created + '" title="' + item.name + '" alt="About Screen 1.0 by ' + item.user + '" src="' + $(this).attr("src") + '" /><div class="tooltip"><h1>' + item.name + '</h1><h2>' + item.user + '</h2><p>' + item.desc + '</p></div></div>');
  12. });
  13. downloadimage.attr("src", item.download);
  14. //}
  15. }
  16. });
  17. var prevpos = 0;
  18. $("body").on("click", ".tooltip", function () {
  19. if (!$("#wrapper").hasClass("insensitive")) {
  20. prevpos = $("html").scrollTop();
  21. $("html").scrollTop(0);
  22. var factor = 750/625;
  23. $("#wrapper").css("height",$(window).height() - 40);
  24. $("#wrapper").addClass("insensitive");
  25. $("body").addClass("open");
  26. $("#grid").css("opacity", "0");
  27. $("html").css("background-color","#fff");
  28. $("#wrapper").css("background-image","url(" + $(this).prev().attr("src") + ")");
  29. }
  30. })
  31. $("body").on("click", ".insensitive", function () {
  32. $("html").scrollTop(prevpos);
  33. var factor = 750/625;
  34. $("#wrapper").css("min-height",$(window).height() - 40);
  35. //$("#wrapper").css("min-height",$("body").height() / factor);
  36. $("#wrapper").removeClass("insensitive");
  37. $("body").removeClass("open");
  38. $("#grid").css("opacity", "1");
  39. $("html").css("background-color","#000");
  40. $("#wrapper").css("background-image","none");
  41. $("#wrapper").css("height","auto");
  42. })
 
 

427

Screen Contest JS toy loader

Screen Contest JS toy loader

SVG Tool

44
言葉
149
サイズ
2.0 KB
作成済み
訂正
3
タイプ
application/jav…
Lesser General Public License v2 (LGPLv2)
コメントするにはログインしてください!