Saturday, August 25, 2012

javascript – Changing img src value

I want the visitors of my web page to able to change the background of my web page when they click a link. I have few skills in javascript and jquery and am not sure how exactly to achieve this. Do display my background i use the following css:



#background {
width: 100%;
height: 100%;
position: fixed;
left: 0px;
top: 0px;
z-index: -1;
}

.stretch {
width:100%;
height:100%;
}


and html –



<img src=\"images/backgrnd.jpg\" class=\"stretch\" id=\"background\" alt=\"\" />






Rating: 2 out of 5 based on 3 ratings



The post javascript – Changing img src value appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/javascript-changing-img-src-value.html

No comments:

Post a Comment