turning webcam into a stretching/scaling background image

dreamlight95

New Member
connecting javascript to css div.I've given some javascript that drives a webcam some new functions such as a delay and to only display when its uploaded successfully for an art project.However I can no longer (for some stupid reason) connect it to my css without overriding the changes that i've made. So that my simple web cam can be a background image that stretches to size on the page.(please see below)I'd love to have the webcam background image be dynamically scaling but I don't think thats not possible in this context.i'm sure you folks are more informed\[code\] <script type="text/javascript">$(document).ready(function(){function reloadBackground() { var d = new Date().getTime(); d -= 15; // delay url = "http://www.panopticbedroom.com/templates/live.jpg?" + d; var img = new Image(); img.onload = function(){ $('#divBackground ').html('').append($(this)); } img.src = http://stackoverflow.com/questions/15755404/url;}setInterval(reloadBackground, 1000);function getDocHeight() { var doc = document; return Math.max( Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight), Math.max(doc.body.offsetHeight, doc.documentElement.offsetHeight), Math.max(doc.body.clientHeight, doc.documentElement.clientHeight) );}});</script>\[/code\]and here is the relevant css:\[code\]#divBackground {background-image: url(http://www.panopticbedroom.com/templates/live.jpg)position: absolute;}img#imgBackground {position: fixed;top: 0;left: 0;width: 100%;height: 100%;}\[/code\]I would really appreciate any advice!all the best,louis
 
Back
Top