Comments (7)
Can you give an example of how you'd want this to work?
from holder.
I placed in css something like this:
background-image: url('holder.js/200x300');
Then Holder checks all element in DOM, in searching css atribute background-image. If found, it changes it. And I'm wondering whether is it worthwhile.
from holder.
It's an interesting idea, though it requires a fair amount of additional processing. I'll see if I can get this into 1.4.
from holder.
I need this too - in the meantime, I have worked around this with custom js (requires jQuery):
var backgroundImageContainer = $("<div>").attr("id", <some_unique_id>).addClass("hidden");
$("body").append(backgroundImageContainer);
Holder.add_image("holder.js?200x200", "#" + backgroundImageContainer.attr("id")).run();
$(<my_element_selector>).css("background-image", "url(" + $("img", backgroundImageContainer).attr("src") + ")");
backgroundImageContainer.remove();
from holder.
Compass allows for inline images to be declared right into the css. I don't know how it works, but it might be of help to have a look in te the source if the proposed functionality is to be included into holder.
from holder.
@jasperkennis Compass encodes the image file using Base64 and embeds it using the data URI scheme. To mirror the same functionality, Holder would need to parse CSS, which at this stage would be unnecessary. I've already tested the CSS placeholder approach, it works, and will be included in 1.4 as soon as possible.
from holder.
This is now implemented, see https://github.com/imsky/holder#background-placeholders
from holder.
Related Issues (20)
- Support Turbolinks 5 HOT 1
- (angular) binding to data-src HOT 3
- [Enhancement] Diagonal lines/border? HOT 8
- Support outline for rounded corners
- How to make images scaled down? HOT 1
- Image with no text HOT 2
- "size" attribute has no affect when using 100% width HOT 1
- Add support for specified aspect ratios. HOT 1
- holderjs not working inside tinymce [fiddle included] HOT 2
- 100% x 100% giving <svg> error in Chrome Canary Version 69.0.3494.0 (Official Build) canary (64-bit) HOT 1
- Could not set size lesser than certain value HOT 1
- holder.js does not work when the page renders twice in React HOT 14
- Refer to FontAwesome icons by their class names HOT 1
- high cpu usage HOT 2
- Issue with rendering in React using state variables HOT 2
- old dependency version prevent install with engine-strict=true HOT 3
- Need to replace `robloach/component-installer` HOT 3
- yoieh:patch-1
- Holderjs with Vite
- How can I use Holder.js in Next.js App Router?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from holder.