ازاين كداستفاده كن قراربده قسمت headادرس عكساست كن روي كد
<script type="text/javascript">
$(document).ready(function() {
$("body").ezBgResize({
img : "bg.jpg", // Relative path example. You could also use an absolute url (http://...).
opacity : 1, // Opacity. 1 = 100%. This is optional.
center : true // Boolean (true or false). This is optional. Default is true.
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$(".bg").load(function(){
resize_bg();
})
$(window).resize(function(){
resize_bg();
})
function resize_bg(){
$("#triquibackimg").css("left","0");
var doc_width = $(window).width();
var doc_height = $(window).height();
var image_width = $("#triquibackimg").width();
var image_height = $("#triquibackimg").height();
var image_ratio = image_width/image_height;
var new_width = doc_width;
var new_height = Math.round(new_width/image_ratio);
if(new_height<doc_height){
new_height = doc_height;
new_width = Math.round(new_height*image_ratio);
var width_offset = Math.round((new_width-doc_width)/2);
$("#triquibackimg").css("left","-"+width_offset+"px");
}
$("#triquibackimg").width(new_width);
$("#triquibackimg").height(new_height);
}
});
</script>