View Single Post
Old 10-08-2012, 04:36 AM   PM User | #9
arfa
New Coder

 
Join Date: Sep 2006
Posts: 51
Thanks: 1
Thanked 0 Times in 0 Posts
arfa is an unknown quantity at this point
This is doing what I had in mind..

Code:
<style>
#bg-wrapper {display:none;margin-left:99px;cursor:pointer}
.change {cursor:pointer}
</style>
<script src="jquery.min.js"></script>
<script>
$(function() {
$('<img>').attr({'src':'chococat.gif','id':'bg','title':''}).appendTo('#bg-wrapper').parent().fadeIn(1000);
    $('.change').click(function(e) { 
    e.preventDefault(); 
    var image = $(this).attr("id").replace("tn_","");
        $('#bg').parent().fadeOut(800, function() {
            $('#bg').attr('src', ''+image); 
              $(this).fadeIn(800); }); }); });
</script>
  </head>
  <body>    
      <span class="change" id="tn_chococat.gif">Cat</span> <span class="change" id="tn_comic.gif">Comic</span> <span class="change" id=tn_devil.gif>devil</span>
	  <BR><BR>
    <div id="bg-wrapper"></div>
arfa is offline   Reply With Quote