Hello
Can anyone advise how I can modify the Daily iFrame Content Script
http://www.dynamicdrive.com/dynamici...dowiframe2.htm
So it becomes a Monthly Content Script (i.e. displays a message for a calendar month)
Many Thanks
Printable View
Hello
Can anyone advise how I can modify the Daily iFrame Content Script
http://www.dynamicdrive.com/dynamici...dowiframe2.htm
So it becomes a Monthly Content Script (i.e. displays a message for a calendar month)
Many Thanks
Change;toCode:var mytoday=mydate.getDate()
and start the page array from 0 (January is 0, December is 11)Code:var mytoday=mydate.getMonth()
Code:daycontent[0]="january.htm"
Many Thanks, I'll give it a go
Sorry - another question, is it possible to add a Forward and Backwards button so a visitor could look forward a month or back a month
i.e. would something like
backButton.onclick = function() {
// do something
}
forwardButton.onclick = function() {
//do something else
}
Work
Thanks
Just looking on the internet if I were to add the following
iframe.contentWindow.history.go(-1); // back
iframe.contentWindow.history.go(1); // forward
Would this work for Buttons to take the Calendar Back or Forwards 1 month
What I'm looking to achieve is a list of events for the current month but allow the visitor to go forward to the next month ot back one month
any assistance appreciated
No because history.go() is looking for page history stored in the browser, so if the month either side hasn't been viewed already, it wont be in the history to navigate to.Quote:
history.go ... Would this work for Buttons to take the Calendar Back or Forwards 1 month
A better approach would probably be to write a nextMonth() and prevMonth() function and then increment the numerical value of 'mytoday' when the appropriate button is clicked.
Hello
I have modified the script and placed the following in the page
I have created the files for the months, the Window appears but with no contentCode:<script type="text/javascript">
/***********************************************
* Daily iframe content II- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Please keep this notice intact
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
var ie=document.all
var dom=document.getElementById
//Specify IFRAME display attributes
var iframeprops='width=380 height=175 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="auto"'
//Specify 31 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 monthcontent=new Array()
monthcontent[0]="January.html"
monthcontent[1]="February.html"
monthcontent[2]="March.html"
monthcontent[3]="April.html"
monthcontent[4]="May.html"
monthcontent[5]="June.html"
monthcontent[6]="July.html"
monthcontent[7]="August.html"
monthcontent[8]="September.html"
monthcontent[9]="October.html"
monthcontent[10]="November.html"
monthcontent[11]="December.html"
//No need to edit after here
if (ie||dom)
document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')
var mydate=new Date()
var mytoday=mydate.getMonth()
function dayofmonth_iframe(){
if (ie||dom){
var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
iframeobj.src=monthcontent[mytoday]
}
}
window.onload=dayofmonth_iframe
</script>
The code you posted works fine here. Have you checked the file names for correct path and case-sensitivity? File extension correct?
An updated script http://fofwebdesign.co.uk/template/_...rames/monthly/
Many thanks