Hello,
I am looking forward for DD Script that could display different messege depend on the day in the year (not day of week or month).
I realy appreciate your help.
Thanks in advanced,
Tal
Hello,
I am looking forward for DD Script that could display different messege depend on the day in the year (not day of week or month).
I realy appreciate your help.
Thanks in advanced,
Tal
Not only is it possible, I've already done it. The only thing is...I'm not entirely sure why you'd want 365 different messages. So, nonetheless, this will work for ANY amount of days up to 365.
Code:<script type="text/javascript"> /*********************************************** * Daily iframe content II- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code * Modified by Nick Faiola to allow +31 URLs ***********************************************/ //Number of Items var itemNum=31 var ie=document.all var dom=document.getElementById //Specify IFRAME display attributes var iframeprops='width=300 height=300 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"' //Specify 'itemNum' URLs to display inside iframe, one for each day of the current month //If this month has less than 31 days, the last few URLs won't be used. var content=new Array() content[1]="" content[2]="" content[3]="" content[4]="" content[5]="" content[6]="" content[7]="" content[8]="" content[9]="" content[10]="" content[11]="" content[12]="" content[13]="" content[14]="" content[15]="" content[16]="" content[17]="" content[18]="" content[19]="" content[20]="" content[21]="" content[22]="" content[23]="" content[24]="" content[25]="" content[26]="" content[27]="" content[28]="" content[29]="" content[30]="" content[31]="" //No need to edit after here var months=new Array(31,28,31,30,31,30,31,31,30,31,30,31) if (ie||dom) document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>') var mydate=new Date() var myMonth=mydate.getMonth() var myToday=mydate.getDate() var myYear=mydate.getYear() var dateOfYear=0 function isLeapYear(year){ if (year%4!=0) return false if (year%100==0){ if (year%400==0) return true return false } return true } function dayOfYear(){ for (i=0;i<myMonth;i++) dateOfYear+=months[i] dateOfYear+=myToday if (myYear<1000) myYear+=1900 if (isLeapYear(myYear) && myMonth > 1) dateOfYear++ dateOfYear=(dateOfYear%itemNum!=0)? dateOfYear%itemNum : itemNum return dateOfYear } function dayofmonth_iframe(){ if (ie||dom){ var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff iframeobj.src=content[dayOfYear()] } } window.onload=dayofmonth_iframe() </script>
Verzeihung!
Hello, i saw the change you made and is great, so i ask you if you think its possible to change this daily iframe content to change every week, for example, every Monday. In this case, what i need is the script change the iframe content every Monday of the year, so that is 53 changes along the year.
Thanks in advance and gr8 job and site.
i've tried to use this script with the "day of year" change, and like i said before i wanted to the content change weekely (every 7 days or every Monday for example), so i gave the same url to days 1/2/3/4/5/6/7 and another different to the days 8/9/10/11/12/13/14 and so on , and it hadn't work for me.
Please, need help with this, i will appreciate it very much
Thanks
I'm particularly interested in how this works. i.e. I have 365 pages that I need displayed on the appropriate days but I see only places for 31 urls. Obviously I'm missing something... which isn't surprising since I am a total newbie at this.Originally Posted by Minos
Any help would be much appreciated![]()
this code is cool!
how can i get the images to load centered to page?
here?
//Specify IFRAME display attributes
var iframeprops='width=1024 height=600 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"'
or here?
content[1]="1.htm"
thank you.
Originally Posted by threeflip
When posting another question, please start a new thread.
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
I have been hunting for a script that would display a quote for each day of the year as this forum is discussing. I noticed the last entry about itsays that Dalarian would like to know more about how it works. II would like to know if I can set it up to read an external text file or database,.
Can some continue with this discussion? I have a calendar of quotes that I would like to put up in a popup window that shows the date and the quote for that day. I was requested by a customer to do this for the visitors that are blind and need there computer to talk to them.
Would it be better to do this using a database and pphp? If so, can you point me to the place I need to go to learn this trick?
Any help would be very much appriciated.
Thanks, Rick
Bookmarks