Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Dynamic Calendar II

  1. #1
    Join Date
    Mar 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Calendar II

    Script Name: Dynamic Calendar II
    Script Link: http://www.dynamicdrive.com/dynamici...dcalendar2.htm

    I have two questions about this script:

    1) Is it possible to adjust it so that when you change months it doesn't jump around when you got to a month that has 6 week lines (as oppsed to the normal 5)?

    2) Is it possible to resize the whole calendar, and make it take up most of a page?

    Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you put it in an element that is absolutely positioned with top and left coordinates specified, it will stop jumping but, formatting it into other content becomes a problem. Or, you could put it in a table with a single row and cell. make the cell like:
    HTML Code:
    <td valign="top" height="280">calendar html goes here</td>
    280 seems to work fine for the demo calendar, if your second idea is used, 280 will need to be a much larger number. As for the second idea - fullpage, easy. Just change every occurrence of '<td' (without the quotes) in the script to '<td class=cal' (without the quotes). Then use this style declaration in the head of the page:
    Code:
    <style type="text/css">
    td.cal {font-size:8em;}
    </style>
    That size is good for 1024x768 resolution, fullscreen. I might, when I get a chance write a routine that will dynamically resize the font for different viewport/screen sizes, but most browsers, including IE, can and often just 'automatically' do this with font sizes set by em's.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that.
    The first part worked fine, and it now no longer jumps around.

    However, with the resizing part for some reason the section above the actual calendar (the next and last buttons, and the month and year boxes) are all over the place. It happens to varying amounts depending on the number i put in the style definition (I chose 3, as 8 was a little too large for my page).

    I have attached my html as a txt doc, as once again, this is for my intranet!

    Thanks again,
    Martyn.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I almost don't have to look but I will. You either added the class=cal to the <td tags in the html code as well as the ones in the script (most likely) or you got the style declaration wrong. Yep, I checked, take the class=cal declarations out of the <td tags below the <body tag and you should be fine.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    OK, lets play spot the newbie who doesn't have a clue what he's doing... I win! (I just looked in the mirror)

    Guess I better keep on learning!

    Thanks for that one jscheuer1, you've been a great help!
    Last edited by Zaph; 04-15-2005 at 12:11 AM. Reason: typo

  6. #6
    Join Date
    Mar 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok, things have gone strange now...

    For some reason my calendar page looks fine in the design view of frontpage, but when i preview it the calendar and dropdown menu shift to the right.

    I know about the rules on using 2 scripts on the same page, but it was working on friday and now it isn't. Might it be a conflict of the style sheets or something?

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Front Page and other WYSIWYG editors do not always show an accurate 'preview'. Also make sure FP has not altered your code, it has been known to do that as well. These are two of many reasons I abhor such editors. Try the page cleanly in a browser before you decide it isn't working. Always backup work before exposing it to FP and other WYSIWYG editors.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Mar 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think it was an issue with IE5 (which is on my work laptop), because when i copied my work back to the server today and previewed the page in IE6 it works fine.

    Oh well, better download the new version

  9. #9
    Join Date
    Mar 2005
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have another couple of formatting questions regarding this script.

    1) Can I reduce the gap between the actual calendar and the selection area at the top for choosing the month/year?

    2) Is it possible to make the "day" boxes wider and have text/links in them?

    I have an example of what I have done so far here:
    http://www.geocities.com/zaphod_beeb.../calendar1.htm

    Thanks,

    Martyn.

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Mine has no such large gap, you've been allowing FP to turn your some of your code into a picture again.

    What kind of links did you have in mind? The days are generated by a set of routines powered by several 'for (var i = 1; i < 8; i++)' statements. If you want the links to be something like this:

    Code:
    <a href="3May2005.htm">Today's Events</a>
    That could be done but, it would be done for each and every day, or just for the current day, or just for the current month. A range of days centering on the current day should be possible. Even individual dates but, the coding for that could be tedious. A subroutine and an array might be added so that individual date links could be configured. At that rate, why not make a calendar with the links you want on it?
    Last edited by jscheuer1; 05-03-2005 at 06:20 PM. Reason: add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •