JS的动态背景图片

JavaScript027

JS的动态背景图片,第1张

$(function(){

var num=0,y=0

function time() { 

num+=80

if(num>400){

num=0

}

$("#fav-icon").css("background-position",num+'px '+y+"px")

$(".fav").hover(function(){

inte= setInterval(time, 500) 

},function(){

clearInterval(inte)

$("#fav-icon").css("background-position",0+'px '+0+"px")

})

})

不知道符合要求不

只是提供思路 希望看一看

1先将控件的src赋值

2用js脚本获取src: var aa=document.getElementById('IMG').src

3用字符截取路径 var s="/images/index/"//图片存放目录

var arr=new Array()

arr=aa.split("images/index/")

var obj=dataList[i].poster

document.getElementById('IMG').src=arr[0]+s+obj//给id为IMG的图片控件赋值

可能有帮助 啊:

javascript中Img的src替换问题:http://hi.baidu.com/wylovemadecao/blog/item/d19bd72f4b10727934a80fce.html

<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

configure:3427: gcc --version >&5

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

Copyright (C) 2007 Free Software Foundation, Inc.

This is free softwaresee the source for copying conditions. There is NO

warrantynot even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.