Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

默认加载图 #10

Closed
jackyzonewen opened this issue Nov 18, 2015 · 1 comment
Closed

默认加载图 #10

jackyzonewen opened this issue Nov 18, 2015 · 1 comment

Comments

@jackyzonewen
Copy link

现在的默认的填充图是grep.gif,如果我设置为我的一个动态的图,例如iOS的菊花,然后菊花会被拉升整个图像的大小,如何处理?

@jieyou
Copy link
Owner

jieyou commented Nov 18, 2015

尝试一下,
弃用IMG,改用background-image的实现形式。最开始给又默认填充图的元素赋予样式
{
background-position:center;
background-size:菊花图实际大小
}
然后再在调用lazyload时多加一个option
$(xxxx).lazyload({
load:function($ele){
$ele.css({
'background-position':'0 0',
'background-size':'auto'
})
}
})

@jieyou jieyou closed this as completed Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants