Neither of those scripts is rated for Firefox. So this is not a bug. But, instead of move this thread to the general help area, because they are both rated for Opera, and do not work in that browser, I'm leaving it here.
Here's the fix for Opera (also now works in Firefox):
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
#theImages {
overflow: hidden;
}
#theImages br {
clear: left;
}
#theImages img {
cursor: pointer;
float: left;
display: block;
}
</style>
<!--[if lt IE 6]>
<style>
#theImages img {
cursor: hand;
}
</style>
<![endif]-->
<script type="text/javascript">
/*
Live Background Previewer Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
(function(addEvent){
function tile(e, source){
e = e || window.event;
e.cancelBubble = true;
source = e.target || e.srcElement;
if(source.tagName && source.tagName.toLowerCase() === 'img'){
document.body.style.backgroundImage = 'url(' + source.src + ')';
}
}
function restore(){
document.body.style.backgroundImage = '';
}
function init(){
addEvent(document, 'click', restore);
addEvent(window, 'load', function(){
addEvent(document.getElementById('theImages'), 'click', tile);
});
};
if(document.getElementById){
init();
}
})((function(){
return window.addEventListener? function(el, ev, f){
el.addEventListener(ev, f, false);
} : window.attachEvent? function(el, ev, f){
el.attachEvent('on' + ev, f);
} : function(){return;};
})());
</script>
</head>
<body>
<div>
<span id="theImages">
<img src="backgr10.jpg" alt="">
<img src="backgr11.jpg" alt="">
<br>
<img src="backgr13.jpg" alt="">
<img src="backgr14.jpg" alt="">
</span>
</div>
</body>
</html>
Bookmarks