◆少前百科是非盈利性、非官方的少女前线维基百科。 ◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科。 ◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科 ◆To foreigners,You can use twitter to contact us. |
“Widget:ProfileCard/sandbox”的版本间的差异
(创建页面,内容为“<includeonly><style> #profilecardview { position: fixed; top: 0; right: 0; border: 1px solid grey; width: 50vw; height: 50vh; text-align:…”) |
|||
第21行: | 第21行: | ||
$("#bodyContent:first").append(view); | $("#bodyContent:first").append(view); | ||
− | function display( | + | function display(){ |
var root = ""; | var root = ""; | ||
var path = this.src.replace(/((https?:)?(\/\/)?www\.gfwiki\.org)/, function(m) { | var path = this.src.replace(/((https?:)?(\/\/)?www\.gfwiki\.org)/, function(m) { | ||
第27行: | 第27行: | ||
}).split("/").slice(3, 6).join("/"); | }).split("/").slice(3, 6).join("/"); | ||
view.src = root + "/images/" + path; | view.src = root + "/images/" + path; | ||
− | var ratioString = $( | + | var ratioString = $(this).parent()[0].getAttribute("data-aspect-ratio"); |
var box = element.getBoundingClientRect() | var box = element.getBoundingClientRect() | ||
if(ratioString && box) { | if(ratioString && box) { |