Advertise Here

Author Topic: [Code] Swap Images on Page  (Read 13045 times)

0 Members and 1 Guest are viewing this topic.

Offline Adds

  • SMF For Free Full Member
  • *
  • Posts: 177
  • Press alt + F4
    • View Profile
    • Turtlelovers

  • Total Badges: 18
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Swap Images on Page
« Reply #15 on: September 27, 2006, 05:37:45 pm »
I have most but i just want defalt because i did more botton changing on that on so yea

GREAT DEALS ON CRUISES & ISLAND GETAWAYS At tru-healthtravel.com

Offline Crasy

  • Global Moderator
  • *
  • Posts: 3960
  • Semi-Retired ;)
    • View Profile

  • Total Badges: 29
    Badges: (View All)
    Poll Starter Poll Voter Seventh year Anniversary Arcade Highscore Windows User
Re: Swap Images on Page
« Reply #16 on: September 27, 2006, 05:39:58 pm »
Done. It should work...I hope I didn't mix the images up or anything.

Code: [Select]
<script type='text/javascript'>
/*
Change Any Image On Page
Created by iFusion
*/
var img_b = new Array();
img_b[img_b.length++] = [ "http://www.smfboards.com/Themes/MidnightMist/images/on.gif" , "http://i71.photobucket.com/albums/i124/king_09/turtleicon.gif" ];
img_b[img_b.length++] = [ "http://www.smfboards.com/Themes/MidnightMist/images/off.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];
img_b[img_b.length++] = [ "http://www.smfsupport.com/support/themes/default/images/on.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];
img_b[img_b.length++] = [ "http://www.smfsupport.com/support/themes/default/images/off.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];

var all_images = document.getElementsByTagName('IMG');
for(i=0;i<all_images.length;i++){
for(j=0;j<img_b.length;j++){
   if(all_images[i].src == img_b[j][0]){
     all_images[i].src = img_b[j][1];
}}}
</script>
Did my answer help you? Want to help out hosting costs?


Every donation counts.

Offline Adds

  • SMF For Free Full Member
  • *
  • Posts: 177
  • Press alt + F4
    • View Profile
    • Turtlelovers

  • Total Badges: 18
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Swap Images on Page
« Reply #17 on: September 27, 2006, 05:49:02 pm »
i cant copy pastethat. if i use paste this comes up
<script type='text/javascript'>
/*
Change Any Image On Page
Created by iFusion
*/
var img_b = new Array();
img_b[img_b.length++] = [ "http://www.smfboards.com/Themes/MidnightMist/images/on.gif" , "http://i71.photobucket.com/albums/i124/king_09/turtleicon.gif" ];
img_b[img_b.length++] = [ "http://www.smfboards.com/Themes/MidnightMist/images/off.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];
img_b[img_b.length++] = [ "http://www.smfsupport.com/support/themes/default/images/on.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];
img_b[img_b.length++] = [ "http://www.smfsupport.com/support/themes/default/images/off.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];

var all_images = document.getElementsByTagName('IMG');
for(i=0;i<all_images.length;i++){
for(j=0;j<img_b.length;j++){
  if(all_images.src == img_b[j][0]){
    all_images.src = img_b[j][1];
}}}
</script>

What do i do??maby u can take off the code thing

GREAT DEALS ON CRUISES & ISLAND GETAWAYS At tru-healthtravel.com

Offline Adds

  • SMF For Free Full Member
  • *
  • Posts: 177
  • Press alt + F4
    • View Profile
    • Turtlelovers

  • Total Badges: 18
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Swap Images on Page
« Reply #18 on: September 27, 2006, 05:50:50 pm »
Maby u should just do it ill give u my pass.?!

GREAT DEALS ON CRUISES & ISLAND GETAWAYS At tru-healthtravel.com

Offline Crasy

  • Global Moderator
  • *
  • Posts: 3960
  • Semi-Retired ;)
    • View Profile

  • Total Badges: 29
    Badges: (View All)
    Poll Starter Poll Voter Seventh year Anniversary Arcade Highscore Windows User
Re: Swap Images on Page
« Reply #19 on: September 27, 2006, 05:52:07 pm »
Nah
Actually what you just posted above is the right code

Put this in your footers(and take out the last code)

<script type='text/javascript'>
/*
Change Any Image On Page
Created by iFusion
*/
var img_b = new Array();
img_b[img_b.length++] = [ "http://www.smfboards.com/Themes/MidnightMist/images/on.gif" , "http://i71.photobucket.com/albums/i124/king_09/turtleicon.gif" ];
img_b[img_b.length++] = [ "http://www.smfboards.com/Themes/MidnightMist/images/off.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];
img_b[img_b.length++] = [ "http://www.smfsupport.com/support/themes/default/images/on.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];
img_b[img_b.length++] = [ "http://www.smfsupport.com/support/themes/default/images/off.gif" , "http://i71.photobucket.com/albums/i124/king_09/off.gif" ];

var all_images = document.getElementsByTagName('IMG');
for(i=0;i<all_images.length;i++){
for(j=0;j<img_b.length;j++){
  if(all_images.src == img_b[j][0]){
    all_images.src = img_b[j][1];
}}}
</script>
Did my answer help you? Want to help out hosting costs?


Every donation counts.

Offline Whane

  • SMF For Free Newbie
  • *
  • Posts: 2
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 First Post
Re: Swap Images on Page
« Reply #20 on: October 06, 2006, 06:25:16 pm »
I'm having a hard time getting this swap to work, can anyone that is willing verify that I have the right code here:

Code: [Select]
<script type='text/javascript'>
/*
Change Any Image On Page
Created by iFusion
*/
var img_b = new Array();
img_b[img_b.length++] = [ "http://www.smfboards.com/ranks/wowranks/wowrank1.jpg
" , "http://www.forenstar.com/board/images/ranks/WowRanks/1.gif" ];

var all_images = document.getElementsByTagName('IMG');
for(i=0;i<all_images.length;i++){
for(j=0;j<img_b.length;j++){
   if(all_images[i].src == img_b[j][0]){
     all_images[i].src = img_b[j][1];
}}}
</script>

Offline Crasy

  • Global Moderator
  • *
  • Posts: 3960
  • Semi-Retired ;)
    • View Profile

  • Total Badges: 29
    Badges: (View All)
    Poll Starter Poll Voter Seventh year Anniversary Arcade Highscore Windows User
Re: Swap Images on Page
« Reply #21 on: October 06, 2006, 06:30:21 pm »
I'm having a hard time getting this swap to work, can anyone that is willing verify that I have the right code here:

Code: [Select]
<script type='text/javascript'>
/*
Change Any Image On Page
Created by iFusion
*/
var img_b = new Array();
img_b[img_b.length++] = [ "http://www.smfboards.com/ranks/wowranks/wowrank1.jpg
" , "http://www.forenstar.com/board/images/ranks/WowRanks/1.gif" ];

var all_images = document.getElementsByTagName('IMG');
for(i=0;i<all_images.length;i++){
for(j=0;j<img_b.length;j++){
 if(all_images[i].src == img_b[j][0]){
 all_images[i].src = img_b[j][1];
}}}
</script>

It seems to me that you are replacing two of the same images. It might be working but it doesn't look like it.

URL to your forum?
Did my answer help you? Want to help out hosting costs?


Every donation counts.

Offline Whane

  • SMF For Free Newbie
  • *
  • Posts: 2
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 First Post
Re: Swap Images on Page
« Reply #22 on: October 06, 2006, 06:36:53 pm »
I'm replacing the jpg version with the gif version (to get a transparent back).

Forum: http://org.smfforfree.com/index.php

Sample post with image to replace (Chevron rank) http://org.smfforfree.com/index.php?topic=4

Offline Crasy

  • Global Moderator
  • *
  • Posts: 3960
  • Semi-Retired ;)
    • View Profile

  • Total Badges: 29
    Badges: (View All)
    Poll Starter Poll Voter Seventh year Anniversary Arcade Highscore Windows User
Re: Swap Images on Page
« Reply #23 on: October 06, 2006, 06:52:13 pm »
I'm replacing the jpg version with the gif version (to get a transparent back).

Forum: http://org.smfforfree.com/index.php

Sample post with image to replace (Chevron rank) http://org.smfforfree.com/index.php?topic=4

Well, your code was technically right. So I'm sure you can set it up yourself. However it technically should be working.

You put it in your footers right?
Did my answer help you? Want to help out hosting costs?


Every donation counts.

Offline Adds

  • SMF For Free Full Member
  • *
  • Posts: 177
  • Press alt + F4
    • View Profile
    • Turtlelovers

  • Total Badges: 18
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Swap Images on Page
« Reply #24 on: October 06, 2006, 07:07:50 pm »
I still cant get ti here u do it. Pm me and ill give u admin abillatise because i cant get it :'(

GREAT DEALS ON CRUISES & ISLAND GETAWAYS At tru-healthtravel.com

Offline Megaman X

  • SMF For Free Newbie
  • *
  • Posts: 13
    • View Profile
    • MegZone

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Swap Images on Page
« Reply #25 on: October 12, 2006, 09:28:07 pm »
can someone change mine too: SMF for free can do the:

I want this pic http://i53.photobucket.com/albums/g74/Hamza_Masud/newposts2.jpg for "new posts" and this one http://i53.photobucket.com/albums/g74/Hamza_Masud/newposts.jpg for "no new posts"

Offline Crystalman

  • SMF For Free Full Member
  • *
  • Posts: 152
  • Crystalman.EXE
    • View Profile
    • Buster Cannon Forums

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Swap Images on Page
« Reply #26 on: October 13, 2006, 01:08:49 am »
It can be done yourself using Webworld X's code. Just follow the directions on the post.


Buster Cannon Forums, and BCF-Comics.

Offline Adds

  • SMF For Free Full Member
  • *
  • Posts: 177
  • Press alt + F4
    • View Profile
    • Turtlelovers

  • Total Badges: 18
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Swap Images on Page
« Reply #27 on: October 13, 2006, 11:09:28 am »
I still cant get it to work i got it on midnight mist but cant on default >:( please help me!!!!!

GREAT DEALS ON CRUISES & ISLAND GETAWAYS At tru-healthtravel.com

Offline Crasy

  • Global Moderator
  • *
  • Posts: 3960
  • Semi-Retired ;)
    • View Profile

  • Total Badges: 29
    Badges: (View All)
    Poll Starter Poll Voter Seventh year Anniversary Arcade Highscore Windows User
Re: Swap Images on Page
« Reply #28 on: October 13, 2006, 01:45:34 pm »
You need to add the post icons for Midnight into the code as well, just add more onto the array.

And Megaman, we need to know what theme you are using. However the directions are self explanitory...
« Last Edit: October 13, 2006, 01:51:35 pm by crasyandconfused »
Did my answer help you? Want to help out hosting costs?


Every donation counts.

Offline Crystalman

  • SMF For Free Full Member
  • *
  • Posts: 152
  • Crystalman.EXE
    • View Profile
    • Buster Cannon Forums

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Swap Images on Page
« Reply #29 on: October 14, 2006, 05:11:26 pm »
I think he's using Midnight mist.


Buster Cannon Forums, and BCF-Comics.

 

Related Topics

  Subject / Started by Replies Last post
26 Replies
17347 Views
Last post November 30, 2009, 06:19:51 pm
by simply sibyl
9 Replies
2370 Views
Last post January 19, 2009, 11:38:45 am
by simply sibyl
1 Replies
1145 Views
Last post March 14, 2009, 11:27:21 pm
by Agent Moose
1 Replies
499 Views
Last post March 10, 2010, 04:17:51 pm
by InsertName