Current location: Hot Scripts Forums » General Web Coding » JavaScript » Image Swap


Image Swap

Reply
  #1 (permalink)  
Old 01-11-05, 04:07 AM
MrDarko's Avatar
MrDarko MrDarko is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Image Swap

I had a previous post about a theme switcher, this is somewhat different i use this to swap images, i like this method but i need to know how or a site that can show em how to implement a cookie so it can remember the image source, and *possibly and hopefully* a css switch as well. But i think i can integrate that myself with the millisons of examples out there.

Code:
<script>
//image src is now "another.gif"
function swap(){
document.getElementById("logo").setAttribute("src","logosmall2.jpg");
document.getElementById("back").setAttribute("src","back2.jpg");
}
function swaps(){
document.getElementById("logo").setAttribute("src","logosmall.jpg");
document.getElementById("back").setAttribute("src","back.jpg");
}
</script>
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
searching image nurqeen PHP 4 07-09-05 09:35 AM
Help with image on form... Adrianaa03 JavaScript 1 10-06-04 07:38 AM
how to draw an image inside a table? davidklonski HTML/XHTML/XML 2 07-06-04 10:27 AM
need help with upload image and getting image name to db mikewooten PHP 3 05-14-04 04:52 PM
How can i do this image swap thing..? heki PHP 2 02-23-04 11:54 PM


All times are GMT -5. The time now is 10:37 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.