Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript

JavaScript

Scheduled Pinned Locked Moved Web Development
questionjavascriptadobe
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    peshawarcoder
    wrote on last edited by
    #1

    i hav three advertisements as flash movies(ad1.swf,ad2.swf,ad3.swf). i hav a combination of object and embed elements. i want these ads to reapted one after the other. each ads should stay for 1 minute. how can i rotate these ads in javascript? Thanks.

    L 1 Reply Last reply
    0
    • P peshawarcoder

      i hav three advertisements as flash movies(ad1.swf,ad2.swf,ad3.swf). i hav a combination of object and embed elements. i want these ads to reapted one after the other. each ads should stay for 1 minute. how can i rotate these ads in javascript? Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      There are many solutions but here is one that might do the trick ... // This section checks to see if the browser is IE4 or higher var RunningIE4 RunningIE4 = (msieversion() >=4); function msieversion() { var ua = window.navigator.userAgent var msie = ua.indexOf ( "MSIE " ) if ( msie > 0 ) // is Microsoft Internet Explorer; return version number return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) ) else return 0 // is other browser } var curBanner curBanner = 0 Bfiles = new Array() // image file names Btargets = new Array() // hyperlink targets Balt = new Array() // alt display Bfiles[0] = "ad1.swf" Btargets[0] = "http://www.the web address" Balt[0] = " description - can be blank" Bfiles[1] = "ad2.swf" Btargets[1] = "http://www.the web address" Balt[1] = " description - can be blank " Bfiles[2] = "ad3.swf" Btargets[2] = "http://www.the web address" Balt[2] = " description - can be blank" function startBanner() { window.setInterval("changeBanner();",60000); } function changeBanner() { if (RunningIE4 == true) { if (curBanner == (Bfiles.length -1)) { curBanner = 0; } else { curBanner++} Banner.src = Bfiles[curBanner] BannerTag.href = Btargets[curBanner] Banner.alt = Balt[curBanner] } } and later in the web page if (RunningIE4 == true) { document.write("&lt;A NAME='BannerTag' HREF='" +Btargets[curBanner]+ "' TARGET='_new'><IMG NAME='Banner' BORDER=0 SRC='" +Bfiles[curBanner]+"' ALT='"+Balt[curBanner]+"' &gt;&lt;/A&gt;") } <NOSCRIPT> <A HREF="non-ie webpage.htm">for non MSIE browsers</A> </NOSCRIPT>

      P 1 Reply Last reply
      0
      • L Lost User

        There are many solutions but here is one that might do the trick ... // This section checks to see if the browser is IE4 or higher var RunningIE4 RunningIE4 = (msieversion() >=4); function msieversion() { var ua = window.navigator.userAgent var msie = ua.indexOf ( "MSIE " ) if ( msie > 0 ) // is Microsoft Internet Explorer; return version number return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) ) else return 0 // is other browser } var curBanner curBanner = 0 Bfiles = new Array() // image file names Btargets = new Array() // hyperlink targets Balt = new Array() // alt display Bfiles[0] = "ad1.swf" Btargets[0] = "http://www.the web address" Balt[0] = " description - can be blank" Bfiles[1] = "ad2.swf" Btargets[1] = "http://www.the web address" Balt[1] = " description - can be blank " Bfiles[2] = "ad3.swf" Btargets[2] = "http://www.the web address" Balt[2] = " description - can be blank" function startBanner() { window.setInterval("changeBanner();",60000); } function changeBanner() { if (RunningIE4 == true) { if (curBanner == (Bfiles.length -1)) { curBanner = 0; } else { curBanner++} Banner.src = Bfiles[curBanner] BannerTag.href = Btargets[curBanner] Banner.alt = Balt[curBanner] } } and later in the web page if (RunningIE4 == true) { document.write("&lt;A NAME='BannerTag' HREF='" +Btargets[curBanner]+ "' TARGET='_new'><IMG NAME='Banner' BORDER=0 SRC='" +Bfiles[curBanner]+"' ALT='"+Balt[curBanner]+"' &gt;&lt;/A&gt;") } <NOSCRIPT> <A HREF="non-ie webpage.htm">for non MSIE browsers</A> </NOSCRIPT>

        P Offline
        P Offline
        peshawarcoder
        wrote on last edited by
        #3

        Thank you for your coopertion.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups