Advertise Here

Author Topic: [Code] Random Banner  (Read 14180 times)

0 Members and 1 Guest are viewing this topic.

Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #15 on: February 18, 2009, 07:35:26 pm »
   If you meant in the space between Categorys I know of no way to do that.

Yes..... Categories is what I should have said.

Ok and thank you..

Offline Pan

  • SMF For Free Member
  • *
  • Posts: 33
    • View Profile
    • MangaFive Forum Community

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Random Banner
« Reply #16 on: May 18, 2009, 10:41:17 pm »
Thanks and it's center. thank you!

Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #17 on: January 03, 2010, 04:11:20 am »
Not sure what I am missing..

Here is an example of what I am placing within my Header and nothing shows up..

Code: [Select]

<script>
var randbanner = []
//Created by Agent Moose (smcodes.smfforfree3.com)
randbanner[0]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg' onclick=location.href='http://taogem.com/taogemst_myzencart/" ' style='cursor: pointer"]
randbanner[1]=["http://farm2.static.flickr.com/1254/906421054_78113b1c8f_o.jpg' onclick=location.href='http://griffincustomopal.com/store/' style='cursor: pointer"]
randbanner[0]=["http://i517.photobucket.com/albums/u340/taogemstones/Bobs_premium_cabs-1.jpg' onclick=location.href='http://bobspremiumcabochons.com/"><' style='cursor: pointer"]

rawr = Math.floor(Math.random()*randbanner.length)
document.write("<center><img src='" + randbanner[rawr][0] + "' /></center>")
</script><p>


Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #18 on: January 04, 2010, 04:27:56 am »
Forum Url: http://gemstone.smfforfree4.com/
I made a couple of changes after looking at the page source for the example link showing what this looks like. Added some quotation marks and also numbered the images starting with 1 instead of zero..

Still not showing up for me when I try to add it to either the header or footer.

Help ?  :)

Code: [Select]

<script>
var randbanner = []
//Created by Agent Moose (smcodes.smfforfree3.com)
randbanner[1]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg" onclick=location.href="http://taogem.com/taogemst_myzencart/" ' style='cursor: pointer"]
randbanner[2]=["http://farm2.static.flickr.com/1254/906421054_78113b1c8f_o.jpg" onclick=location.href="http://griffincustomopal.com/store/' style='cursor: pointer"]
randbanner[3]=["http://i517.photobucket.com/albums/u340/taogemstones/Bobs_premium_cabs-1.jpg" onclick=location.href="http://bobspremiumcabochons.com/"><' style='cursor: pointer"]

rawr = Math.floor(Math.random()*randbanner.length)
document.write("<center><img src='" + randbanner[rawr][0] + "' /></center>")
</script><p>


Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Random Banner
« Reply #19 on: January 04, 2010, 11:55:29 am »
taogem -  you have it correct except you replaced some single quotes with double quotes and visa versa.
Ive corrected the code for you - this one works

Code: [Select]
<script>
var randbanner = []
//Created by Agent Moose (smcodes.smfforfree3.com)
randbanner[0]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg' onclick=location.href='http://taogem.com/taogemst_myzencart/' style='cursor: pointer"]
randbanner[1]=["http://farm2.static.flickr.com/1254/906421054_78113b1c8f_o.jpg' onclick=location.href='http://griffincustomopal.com/store/' style='cursor: pointer"]
randbanner[2]=["http://i517.photobucket.com/albums/u340/taogemstones/Bobs_premium_cabs-1.jpg' onclick=location.href='http://bobspremiumcabochons.com/' style='cursor: pointer"]
rawr = Math.floor(Math.random()*randbanner.length)
document.write("<center><img src='" + randbanner[rawr][0] + "' /></center>")
</script>

Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #20 on: January 04, 2010, 09:57:40 pm »
That did the trick !!

Thanks a bunch !  :)

Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #21 on: January 05, 2010, 02:23:35 am »
Just one more question...

Is there a way to be able and right click on the banners so that they can be opened in a new page ?


Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #22 on: January 05, 2010, 09:56:38 pm »
Forum Url: http://gemstone.smfforfree4.com/
Another question members are asking..

Is there a way to have multiple banners show up at the same time during each page refresh ?  I am hoping from within the same script rather than multiple scripts ?

Also, would still like to know if there is something that can be done about being able to right click on the banners for opening in new page.

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Random Banner
« Reply #23 on: January 05, 2010, 09:59:50 pm »
hi tao  ;)      Unless someone else can figure out a way to tweak that code to do both things for you will have to wait on Moose to see this.   Now that he is off to college we don't see him as often Im afraid.

Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #24 on: January 06, 2010, 09:35:10 pm »
Okedokey..... !

I found another script online that is letting us right click on the random banners so as to open in a new page..  :)


Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #25 on: May 04, 2014, 03:53:53 pm »
Forum Url: http://gemstone.smfforfree4.com/
I would like to know if someone can make this code so that when someone clicks on the clickable banners, a new browser will open for that banners website so that they do not leave/loose the forum page..

Even if the banner could be "right clicked" to open in new window.  Even that could help..


Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #26 on: May 05, 2014, 03:33:05 am »
Forum Url: http://gemstone.smfforfree4.com/
I would like to know if someone can make this code so that when someone clicks on the clickable banners, a new browser will open for that banners website so that they do not leave/loose the forum page..

Even if the banner could be "right clicked" to open in new window.  Even that could help..



Anyone ?

Or am I posting this request in the wrong board ?

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: [Code] Random Banner
« Reply #27 on: May 17, 2014, 12:23:52 pm »
Instead of using this, for example:
Code: [Select]
randbanner[0]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg' onclick=location.href='http://taogem.com/taogemst_myzencart/' style='cursor: pointer"]
Try this:
Code: [Select]
randbanner[0]=["http://farm3.static.flickr.com/2119/1683360334_283534ea14_o.jpg' onclick='window.open(\"http://taogem.com/taogemst_myzencart/\")' style='cursor: pointer"]
Check out Revolution X's Brand new Code Index!

Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #28 on: May 17, 2014, 04:02:37 pm »
Thank you !

 

Related Topics

  Subject / Started by Replies Last post
10 Replies
1548 Views
Last post February 09, 2008, 10:56:34 pm
by taogem
19 Replies
2022 Views
Last post March 29, 2008, 11:06:29 am
by Blade
4 Replies
744 Views
Last post April 06, 2008, 11:38:51 am
by Max.
5 Replies
2079 Views
Last post June 19, 2008, 08:13:56 am
by 3lf-ครรครรเภ
0 Replies
1405 Views
Last post May 05, 2014, 03:38:41 am
by taogem