JavaScript - Code Delaying The Banner.
Hi All,
I came across various codes that is used to delay the banner from not loading while the document is loading but i got struck with this one, this one sounds interesting but confusing, Which page in this code is delaying the banner & how to adjust that (to delay further or to speedup)- http://en.wikipedia.org/wiki/Script?...AFS020fader_US Similar Tutorials-edit - nevermind. mods plz delete.
heya, ^.^ sorry if this is in the wrong section, im new here so i wasn't sure as it concerns both java and php, so basically i've made a website that pings a server address when someone views the site, but currently it will ping every time you f5 or refresh ect, what i need it to do is only ping once every 2mins, store the value for when its not being pinged to be displayed, now i got told this could be done in javascript?, but my knowledge of javascript is very minimal, i also got told that "var m_pingDomain_timer = setInterval(dopingDomain, 120);" may have something to do with it?, and help /code or pointers in the right direction would be a great help , il leave you with the PHP code so you can look over below Code: <tr> <td class="SEBody1"> <?php // Function to check response time error_reporting(0); function pingDomain($domain) { $starttime = microtime(true); $file = fsockopen ($domain, 80, $errno, $errstr, 10); $stoptime = microtime(true); $status = 0; if (!$file) $status = -1; // Site is down else { fclose($file); $status = ($stoptime - $starttime) * 1000; $status = floor($status); } return $status; } echo '<table>'; $domainbase ="google.com"; $status = pingDomain($domainbase); if ($status != -1) echo "<img src='img/shard_status_online.png' width='18' height='18' alt='Online' />Online"; else echo "<img src='img/shard_status_offline.png' width='18' height='18' alt='Offline' />Offline"; echo '</table>'; ?> </td> <td class="SEBody1">로그인</td> <td class="SEBody1">Login</td> <td class="SEBody1"> <?php if ($status !=-1) echo "$status ms"; else echo "0 ms"; ?> </td> </tr> http://everythingsyoga.netau.net/Ang...ite2/Eat.html# The second link to the right "Eat our Famous" is the link in question, you'll notice the div on the left has about a 3 second delay. Any thoughts? Thanks. Hello to all, new to this forum so pardon any mistakes in my question. I have an overlay that contains a video which loads upon page load. Code: <script type="text/javascript"> $(function() { $("#intro_video").overlay({ mask: { color: '#000', loadSpeed: 1000, startOpacity: 0, zIndex: 9997, opacity: .85 }, top: 131, closeOnClick: true, load: true, onLoad: function(){ var $overlay = this; setTimeout(function(){$overlay.close()}, 44000) }}); }); </script> I'd like to delay this by about 5 seconds or so but can't figure out how to do so as I am a JS n00b. The overlay is contained in a div: <div id="intro_video"> Thank you for your help. Hi all, On my website I've got a simple animated .gif I want to play each time someone clicks a link on the menu bar. The problem is that while the image changes successfully, the webpage changes too quickly so the animated.gif won't play. I'm assuming this has something to do with setTimeout though I'm too much of a noob at Java to get this right. Here is one of the buttons: Code: <a href="facts.html" onmouseover='facts.src="images/thefactsbutton2.jpg"' onmouseout='facts.src="images/thefactsbutton.jpg"' onclick='top.src="images/chimneytopsm.jpg"'> <img name="facts" src="images/thefactsbutton.jpg" /> </a> so i have to use the addEvent() to call the makeBannerAd function which i believe i have done so.... but then i gotta <div id = "bannerBox"> </div> and loop through all the iteams in my adsURL Array and for each item i must create the html fragment <div class = "bannerAd"> <a href = "url"> <img src = "bannerindex" /> </a> </div> i must set the z index number to each number ad to the value of the counter index and append the banner ad to the banner Box element.....Append the bannerBox to the documentbody, run the changeBannerAd() every 10 sec Banners.js Code: //this is the global scope here when you declare out side of a function it because global or at the top of the js file var nextAd; //this is going to be used to change or show the next banner ad to the web page function addEvent(object, evName, fnName, cap) { makeBannerAds(); if (object.attachEvent) { object.attachEvent("on" + evName, fnName); }//end if else if (object.addEventListener) { object.addEventListener(evName, fnName, cap); }//end else if }//end function addEvent function makeBannerAds() { //this creates a banner box to store the banner ads in var bannerBox = document.createElement("div"); bannerBox.id = "bannerBox"; for(var i = 0; i < document.adsURL.length; i++) { if(adsURL[i] != <div class = "bannerAd">, <a href ="url">, <img src ="bannerindex" />, </a>, </div>) { if (adsURL[i] = <div class = "bannerAd">, <a href ="url">, <img src ="bannerindex" />, </a>, </div>) else return adsURL[i] = <div class = "bannerAd">, <a href ="url">, <img src ="bannerindex" />, </a>, </div>; }//end if }//end if }//end function makeBannerAds ads.js Code: function storeURL() { //this creates a new array, the array is called adsUR: var adsURL = new Array(); //this stores each item in the array using a index place holder adsURL[0] = "testpage0.htm"; adsURL[1] = "testpage1.htm"; adsURL[2] = "testpage2.htm"; adsURL[3] = "testpage3.htm"; adsURL[4] = "testpage4.htm"; adsURL[5] = "testpage5.htm"; adsURL[6] = "testpage6.htm"; adsURL[7] = "testpage7.htm"; adsURL[8] = "testpage8.htm"; adsURL[9] = "testpage9.htm"; adsURL[10] = "testpage10.htm"; adsURL[11] = "testpage11.htm"; }//end function storeURL books.html file Code: <head> <!-- --> <title>Online Bookworms</title> <link href="bw.css" rel="stylesheet" type="text/css" /> <link href="bannerstyles.css" rel="stylesheet" type="text/css" /> <script src ="ads.js" type ="text/javascript"></script> <!--calls the external file called slideshow.js --> <script src ="banners.js" type ="text/javascript"></script> <!--calls the external file called slideshow.js --> </head> <body> <div id="page"> <h1 id="heading"><img src="bwlogo.jpg" alt="Online Bookworms" /></h1> <ul id="menu"> <li><a href="#">Home</a></li> <li><a href="#">Reviews</a></li> <li><a href="#">Forums</a></li> <li><a href="#">Book Swaps</a></li> <li><a href="#">OBW Store</a></li> <li><a href="#">Author's Corner</a></li> <li><a href="#">My Account</a></li> </ul> <ul id="menu2"> <li><a href="#">My Reading List</a></li> <li><a href="#">Review a Book</a></li> <li><a href="#">Join a Discussion</a></li> <li><a href="#">Post to a Forum</a></li> <li><a href="#">My Mail</a></li> <li><a href="#">My Posts</a></li> <li class="newgroup"><a href="#">Reading Recommendations</a></li> <li><a href="#">Books of the Month</a></li> <li class="newgroup"><a href="#">MP3 Downloads</a></li> <li><a href="#">Podcast</a></li> <li><a href="#">RSS Feeds</a></li> <li class="newgroup"><a href="#">Tech Support</a></li> <li><a href="#">Comments</a></li> <li><a href="#">About online BookWorms</a></li> </ul> <div id="main"> <h2>Welcome</h2> <p>Welcome to <strong>online BookWorms</strong> — your location on the Web for books, magazines, short stories, poetry, and essays. Please explore our online bookstore for the lowest prices on new and rare books. Share your love of reading by joining one of our many forums and discussion groups. Are you an aspiring critic? We welcome book reviews and essays on your favorite authors and works. </p> <h2>News</h2> <p>We are very happy to introduce the <a href="#">online BookWorms Podcast</a>. The podcast will contain free excerpts from great works of fiction and reviews of current books. You can quickly subscribe to this new BookWorms feature <a href="#">here</a>. </p> <p>Take a few moments now to explore our book shelves. And remember to patronize our sponsors by clicking the banner ads at the top of the page. Enjoy browsing our site! <p id="signature"> <img src="signature.jpg" alt="Helen Ungerstatz" /> </p> </div> </div> </body> </html> Hi I am using the following code to create rotating banners. This all works when I fill in links to swf files on all 5 of my fields and then set a limit in the limit field. What I want to be able to do is have the ability to only have one banner field filled in with the rest blank but this breaks the page when the is nothing in the other 4 fields or have 2 filled in etc etc Code: <script> var maxFlashAdNo=100; adFlashNo= Math.round(Math.random() * maxFlashAdNo); var logolimit2="<%=requestItem.getFieldValue("iLogo2")%>"; var logolimit3="<%=requestItem.getFieldValue("iLogo3")%>"; var logolimit4="<%=requestItem.getFieldValue("iLogo4")%>"; var logolimit5="<%=requestItem.getFieldValue("iLogo5")%>"; var secflash=logolimit2; var thirdflash=logolimit3; var fourthflash=logolimit4; var fifthflash=logolimit5; //alert("2=" + secflash); //alert("3=" + thirdflash); //alert("4=" + fourthflash); //alert("5=" + fifthflash); //alert(adFlashNo); if(fifthflash>0&&adFlashNo>fifthflash){ document.write("<%=requestItem.getFieldValue("sLogo5").replaceAll("\"","'")%>"); }else if(fourthflash>0&&adFlashNo>fourthflash){ document.write("<%=requestItem.getFieldValue("sLogo4").replaceAll("\"","'")%>"); }else if(thirdflash>3&&adFlashNo>thirdflash){ document.write("<%=requestItem.getFieldValue("sLogo3").replaceAll("\"","'")%>"); }else if(secflash>2&&adFlashNo>secflash){ document.write("<%=requestItem.getFieldValue("sLogo2").replaceAll("\"","'")%>"); }else{ document.write("<%=requestItem.getFieldValue("sLogo").replaceAll("\"","'")%>"); } </script> Hi, I've created following script: Code: <script type="text/javascript"> banners=new Array; banners[1]="http://i33.servimg.com/u/f33/14/73/69/91/110.png"; banners[2]="http://i33.servimg.com/u/f33/14/73/69/91/210.png"; banners[3]="http://i33.servimg.com/u/f33/14/73/69/91/510.png"; banners[4]="http://i33.servimg.com/u/f33/14/73/69/91/310.png"; banners[5]="http://i33.servimg.com/u/f33/14/73/69/91/410.png"; function ShowBANNERS() { num = Math.random(); num = 1 + ( num * ((banners.length - 1)-1)); num = Math.round(num); document.write("<style> #i_logo { background-image : url('" + banners[num] + "'); } <\/style>"); } ShowBANNERS(); </script> ... And I was thinking if there was a way to create a select/value script, were the user can choose on of the banners inside the select/value - like... Code: <select> <option value="banners1">1. Banner</option> <option value="banners2">2. Banner</option> <option value="banners3">3. Banner</option> <option value="banners4">4. Banner</option> <option value="banners5">5. Banner</option> <option value="bannerrotator">Random Banner</option> </select> <input type="button" value="submit"> The following option will then choose one valued banner, and will be the new banner on the site, when clicking submit (the bannerrotator value, will rotate the banners, so there aren't one chosed all the time). I can figure out I also have to use cookies to this, but I aren't the best at it (I only know the basic properties). Thanks (: Hi all, I am using Javascript for rotating 2 images. In the head section, var maxAdNo = 1 var adNo var myAd = new Array() myAd[0] = '<img src="images/sponsor-box-1.jpg" width="322" height="306" border="0">' myAd[1] = '<img src="images/sponsor-box-2.jpg" width="322" height="306" border="0">' In the body, <script type="text/javascript"> <!-- Begin adNo = Math.round(Math.random() * maxAdNo) document.write(myAd[adNo]) // End --> </script> I want to rotate these 2 images 50% / 50% i.e. alternate image to be loaded for every page refresh instead of random. What is to be done? Thank you in advance. Hi everyone. I am running a short url service with payment... So now we have 1 full ad advertising and banner advertising. On Full ad page For users to skip the full ad page they must click on the banner on the header so then go main link. <a href="{$_WEB_URL}"> is the link on the database tat it has been shortened. So when guests click on the banner the banner opens in new window but the page does not start to forward to main url. Can some one help me on this ..? I tried this : <div class="lb_ad"> <a href="{$_WEB_URL}"> <div onclick="redir()"> <!-- START all AdPeeps.com Code --> <p align="center"> <script type="text/javascript" src="http://paytox.us/advertises/adpeeps.php?bfunction=showad&uid=100000&bmode=off&gpos=center&gwidth=90&bzone=de fault&bsize=all&btype=3&bpos=default&ver=2.0&btotal=1&brel="nofollow" target=_blank&bbo rder=0"> </script> <noscript> <a href="http://paytox.us/advertises/adpeeps.php?bfunction=clickad&uid=100000&bmode=off&bzone=default&bsize=all&btype =1&bpos=default&ver=2.0" rel="nofollow" target="_blank"> <img src="http://paytox.us/advertises/adpeeps.php?bfunction=showad&uid=100000&bmode=off&bzone=default&bsize=all&btype= 1&bpos=default&ver=2.0" alt="Click Here!" title="Click Here!" border="0" /></a> </noscript> </p> <!-- END AdPeeps.com Code --> </div> </a> </div> Hello, I'm looking for an option for a rotating banner on a website. I'd like to have a banner that rotates per visit. I don't mean every time a person returns to a website. I mean person A comes to the site and banner A is displayed. Then person B comes to a site and another banner is displayed. Is this possible? Hi guys, I need some help. I'm trying to make a banner in java or jquery. Idea is div 1 div 2 div 3 div 4 >> custom div1 button >> custom div2 button >> custom div3 button >> custom div4 button I've also added an image of something i have in mind... i can do the CSS but i can't figure out a good tutorial. The closest I found on google was this http://cssglobe.com/lab/easyslider1.7/02.html but its with numbers.. Hi everybody Im new here and javascript newbie ,so I need your helps I want to use a left floating banner on my site www.guruht.com so the floating banner don't cover any text content when a visitor zoom in the page or use a very low resolution like 800x600 or 1024x700. this is the code I use but the banner cover the text : Code: <style> #floating_banner_bottom { text-align: left; width: 00%; bottom: 00px; margin-bottom: 0px; height: 50px; position: fixed; z-index: 50; left: 0px; </style> <div id="floating_banner_bottom"> <!-- Button to Close Banner --> <a style="display:scroll;position:fixed;bottom:50px;left:0px"> banner code <br /> <div class="close"> <a href="#" onclick="document.getElementById('floating_banner_bottom').style.display='none';return false;"> <i style="font-family: Georgia,"Times New Roman",serif;"><span style="background-color: #999999; color: white; font-size: small;"></span></i> <center> <img border="0" width="20" height="20" src="http://lh5.ggpht.com/_9vgJ1nwu_xA/S1jSp2ZhA7I/AAAAAAAAB8A/2AEBd4mR9qA/x.png" /> </center> </a> </div> <a/> </a></a></div> <!-- End Here --> Hi, I have an animated banner on my homepage. I have a CSS menu. The CSS menu is appearing behind the JS banner. Only in one version of IE8 (8.0.6001.18702). Other version of IE 8, it works fine. I have set all the Z-index values in the CSS. I was wondering if you could add anything in the JS. Like for SWF you can set <param name="wmode" value="transparent">. The site is http://capitalshores.com/ I am using this slideshow: http://www.dynamicdrive.com/dynamici...nslideshow.htm Thanks, Ryan I have a banner ad at the top of the page (created by javascript). It is sometimes flash, sometimes a div, sometimes just an image (the ad company determines this). I need it to appear at the top of the page, but I want it to load AFTER all of the rest of the page content has loaded. Here is a test page I've created to demonstrate this: http://jeremymoritz.com/js-test.php Here is the code with the javascript at the bottom so it will load last: Code: <html> <head> </head> <body> <div id='ad_spot'> <!--ad needs to go here--> </div> <div id='content'> <!--Content--> </div> <div id='load_last'> <script defer='defer' type="text/javascript"> var __fbr_pid = "1746"; var __fbr_bid = "18281"; var __fbr_sid = "4568"; var __fbr_size = "728x90"; var __fbr_auid = "28762"; var __fbr_zone = ""; </script> <script type='text/javascript' src='http://ads.foodieblogroll.com'></script> </div> </body> </html> </div> I've tried many things to fix this, but the javascript usually creates elements (iframes, divs, etc.) that are OUTSIDE of container div so manipulating the dom (to move the div or its contents to the <div id='ad_spot'>)has yielded unexpected results. Thank you in advance for your help! I'm trying to displaying a different banner each time someone reloads a page. I did this originally without a cookie and while it works, it has a tendency to display the same banner 3 or 4 times in a row, on occasion. I've never dealt with cookies before, but thought it might be an option for this. However, what I have below isn't working at all. Is it even on the right track?? thanks! Code: <script type="text/javascript"> function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + "; " + expires; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i<ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1); if (c.indexOf(name) != -1) return c.substring(name.length, c.length); } return ""; } function checkCookie() { var banner = getCookie("banner"); if (banner = "") { document.write("<a href='/donate'>"); document.write("<img src='ad1.jpg' />"); document.write("</a>"); setCookie("banner1", banner, 1); } else if (banner = "banner1") { document.write("<a href='/donate'>"); document.write("<img src='ad2.jpg' />"); document.write("</a>"); setCookie("banner2", banner, 1); } else if (banner = "banner2"){ document.write("<a href='/donate'>"); document.write("<img src='ad3.jpg' />"); document.write("</a>"); setCookie("banner3", banner, 1); } else { document.write("<a href='/donate'>"); document.write("<img src='ad1.jpg' />"); document.write("</a>"); setCookie("banner3", banner, 1); } } } </script> </head> <body> <div id="main"> <div id="ads" onclick="checkCookie()"> </div> Hi All! I'm somewhat new to CSS/Javascript but need assistance finding code that will help me accomplish the tool on the following page: http://www.constantcontact.com/index.jsp If you look at the rotating information on the left-side of the Constant Contact website, I would like to be able to have that same functionality on my website. If anyone knows how this is accomplished, any assistance would be greatly appreciated. I am looking for the following functionality: 1) Have the ability to hover over each number to change the main photo 2) Have the script advance the main photo on its own 3) Be able to click the main photo when it is selected Any questions, let me know! Thanks, Eric Hi, I'm trying to figure out how to put up links on a rotating homepage banner. I've tried everything I could find through Googling, etc. and nothing seems to work. Is this because the coordinates for the banner links need to be set in Flash? I tried to set them in Flash but didn't have enough experience with the program. Is there a way I can put some custom code in for the links? Any help would be much appreciated. Thanks! |