Background Image change on click Slider Image

Posted: September 18, 2012 in Java Scripts

=============================================================================================
Java Script

function updateBGImage( image ){
url = “url(‘images/”+image+”‘)” ;
document.getElementById( ‘main_bg_img_block’ ).style.background = url ;
}
function updageToOrgImage( image ){
url = “url(‘images/”+image+”‘)” ;
document.getElementById( ‘main_bg_img_block’ ).style.background = url ;
}

=============================================================================================
HTML

div class=”slider-img” onmouseover=”updateBGImage( ‘top-bg-featured.jpg’)” onmouseout=”updageToOrgImage( ‘top-bg-arts.jpg’ )”> <img src="images/gallery1.jpg"

=============================================================================================
CSS

.slider-img {width:135px; height:130px; float:left; margin:0 7px 0 7px;}

Advertisements
Comments
  1. it’s my first time visiting here. and i found so many entertaining stuff in this blog, especially its discussion.. lista de emails lista de emails lista de emails lista de emails lista de emails

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s