imsky / holder

:city_sunrise: Client-side image placeholders.
http://holderjs.com
MIT License
5.84k stars 593 forks source link

General Question #191

Closed tasmanwebsolutions closed 8 years ago

tasmanwebsolutions commented 8 years ago

When adding

<script type="text/javascript">
$( document ).ready(function() {
// For holder body image
Holder.addImage("holder.js/100px380?theme=social", "body").run();
});
</script>

It adds it to the body in the wrong position should be at top of page

holder

Is there any way to add it into a css link instead like below which I have tried but background image link not working.

body {
    padding-top: 64px;
    background-color: #E7E7E7;
    background-image: url("holder.js/100px380");
}

I have tried this but no luck the path is correct

<body style="background: url(<?php echo base_url('assets/catalog/javascript/?holder.js/100x380?theme=simple');?>);"> It echos out

<body style="background: url(http://localhost/codeigniter/assets/catalog/javascript/?holder.js/100x380?theme=simple);">

imsky commented 8 years ago

addImage appends the placeholder: https://github.com/imsky/holder/blob/v2.9.3/src/lib/index.js#L55

you can do one of several things: