Ken2812221(留言墙 | 貢獻) 小无编辑摘要 标签:sourceedit |
Ken2812221(留言墙 | 貢獻) 小无编辑摘要 标签:sourceedit |
||
第1行: | 第1行: | ||
<img src="http://vignette2.wikia.nocookie.net/tos/images/f/f6/%3Fi.png/revision/latest/scale-to-width-down/60?cb=20130204090140&path-prefix=zh" width="60" height="60" id="chooser" /> |
<img src="http://vignette2.wikia.nocookie.net/tos/images/f/f6/%3Fi.png/revision/latest/scale-to-width-down/60?cb=20130204090140&path-prefix=zh" width="60" height="60" id="chooser" /> |
||
− | <div id="monsters" style="display: none; overflow: visible; position: fixed; height: 500px; top: 100px"></div> |
+ | <div id="monsters" style="display: none; overflow: visible; position: fixed; height: 500px; top: 100px; background: url(http://images2.wikia.nocookie.net/tos/zh/images/9/98/Bg.jpg)"></div> |
<script> |
<script> |
||
(function Test() { |
(function Test() { |
2015年10月2日 (五) 16:54的版本
<img src="" width="60" height="60" id="chooser" />
<script> (function Test() { if(typeof jQuery === 'undefined') { setTimeout(Test, 100); return; }
var container = $('#monsters'); var chooser = $('#chooser').click(function() { container.show(); });
function onSelect() { chooser.attr('src', $(this).attr('src')); container.hide(); }
for(var i = 0; i < 10; i++) {
var p = $('
'); p.appendTo(container); for(var j = 0; j < 10; j++) { var id = i * 10 + j + 1; $('<img src="http://d1hay2czif3g5i.cloudfront.net/facebook/100/' + id + '.png" width="60" height="60" data-id="' + id + '"/>').click(onSelect).appendTo(p); } } })(); </script>