Reduce The Size Of Calendar?

Mar 18, 2010

How can I reduce the size of this calendar that it was built by jQuery UI?

PHP Code:

<script type="text/javascript">
$(function() {
$("#datepicker").datepicker();
});
</script>
<div id="datepicker"></div>

[URL]

I like that calendar but it is too big for my website...

View 5 Replies


ADVERTISEMENT

Calendar Window Is Not Coming Up In Firefox / Chrome When Click On The Calendar Img (working Fine In IE)

Feb 10, 2010

The following code is working fine only in IE. when i click on the calender img, calender window is not coming up in firefox/chrome.

[Code]....

View 8 Replies View Related

JQuery :: For Looping To Reduce Code

Sep 22, 2009

I have 5 buttons all using the same code:
$(".but1").mouseenter(function(){
$(".but1>.launch").animate({ left: "10px"}, 250 );
});
$(".but1").mouseleave(function(){
$(".but1>.launch").animate({ left: "0px"}, 250 );
});
$(".but2").mouseenter(function(){
$(".but2>.launch").animate({ left: "10px"}, 250 );
});
$(".but2").mouseleave(function(){
$(".but2>.launch").animate({ left: "0px"}, 250 );
});
$(".but3").mouseenter(function(){
$(".but3>.launch").animate({ left: "10px"}, 250 );
});
$(".but3").mouseleave(function(){
$(".but3>.launch").animate({ left: "0px"}, 250 );
});
$(".but4").mouseenter(function(){
$(".but4>.launch").animate({ left: "10px"}, 250 );
});
$(".but4").mouseleave(function(){
$(".but4>.launch").animate({ left: "0px"}, 250 );
});
$(".but5").mouseenter(function(){
$(".but5>.launch").animate({ left: "10px"}, 250 );
});
$(".but5").mouseleave(function(){
$(".but5>.launch").animate({ left: "0px"}, 250 );
});
Is there a way to do this in fewer lines of code?

View 12 Replies View Related

JS Reduce - Implement A Function Called Map

Jan 3, 2011

I need to implement a function called map (it needs to be written using reduce) in the below code that takes an array (arr) and a function (iter) as its arguments and returns an array with all its items transformed by iter, e.g. map([1, 2, 3, 4, 5], function(x) {return x * 2;}) should return [2, 4, 6, 8, 10]

View 6 Replies View Related

JQuery :: Combining Script To Reduce Load Time?

Aug 14, 2010

I found out that (after an system update?) IE8 no longer loads the content on my website www.beautifullalaland.com. I guess it has to do with the ridiculous amount of jQuery calls that some of the simple functions requir. using JS for years but never a library (and never again if you ask me, what a bloody mess).

Is there a safe way to combine jquery_002.js, jquery.js, jquery_003.js and jquery-1.3.2.js?

View 9 Replies View Related

Repetition Of Char - Compact Sintax To Reduce The Number Of The Char Inside The Text Below ?

Nov 22, 2011

I have this function that works well, but I ask ... is it possible to have a compact sintax to reduce the number of the char inside the text below ??

function change_txarea(val) {
if (val=='I') {
document.FrontPage_Form1.ob1.value = "Description " +[code3].....

View 5 Replies View Related

Accessibility: Possible To Determine Browser-chosen Point Size Of A Relative Font-size?

Jul 23, 2005

All my font-sizes are set as relative sizes in CSS (large, medium, small,
x-small, etc). Let's say something is set in CSS to be xx-large, but a
visually impaired user wants it displayed even bigger. Can a script
determine an element's absolute size, *as it is being rendered by the
browser*, and then increment the element's font-size in absolute terms?

View 1 Replies View Related

Resizing DIV - Makeweb Page That Adapts To Size Of Your Browser Size When Maximized

Jul 19, 2010

I'm attempting to make a web page that adapts to the size of your browser size when it maximized. Because I'm only 15 I'm not such a great programmer or coder. I've done my best with the resources I have though (Fluent in Lua and a natural ability to pick languages syntax up quickly)

Here is what I have so far, it doesn't work and it is starting to puzzle me. As it seems correct as I look at it. I'm sorry if this question show my ignorance. I try my best to hide it.

Some of it is Copy pasted from sources on Google. But only for educational purposes, I learn off reading, examining and testing out snippets.

I'm basically trying to get the max size of the window and resize the div accordingly.

View 1 Replies View Related

Font Size Aspect Ratio Change With Window Size

Apr 14, 2011

where da boss wants our a large piece of our site to be fully dynamic and integrated on any screen size. This means changing font on size. Well I cam up with a solution, figured if no one has one better, then i'll share

[Code]..

View 7 Replies View Related

JQuery :: Adjust Content Size According To Size Of Window?

Aug 26, 2011

I am new to Jquery mobile framework.I have an asp.net web application and I want to convert it into Jquery mobile framework.I have a datalist on an aspx page.The size of the datalist decreases according to the window size to certain extent after which the size of the datalist becomes constant and doesn't decrease with the window size.

View 2 Replies View Related

Dynamically Resize Font Size When Browser Size Changes?

Dec 11, 2010

How can I change my text or font size when the user changes the browser size. Example: When the browser is maximized, the font goes to normal, when the browser window decreased, the font size is reduce.

View 3 Replies View Related

OffsetHeight For Various FontSizes And Be Able To Reduce The OffsetHeight

Jul 23, 2005

My program has divs that contain a single text node. I programatically set the myDiv.style.fontSize = "8pt"; When I call myDiv.offsetHeight, the number "14" is returned. I would like to be able to both predict the offsetHeight for various fontSizes and be able to reduce the offsetHeight.

View 10 Replies View Related

Limit File Size Or Request Size

May 27, 2010

I developed a web application and it is working fine, except for one issue. The application includes uploading files from a JSP to my servlet, and the issue is that i would like to have a limit for the uploaded files on the client side (before actually uploading it).

I investigated alot and found some ways like changing my JSPs to PHPs, which is not feasable for my application. I would also like to add that using the Flash component ("<object>") for uploading is not feasable also at this time. Using ActiveX does not work also (for some security issues in javascript, it can not access the system information, also ActiveX works only on IE).

I would like to add that I have my application running on Oracle application Server, JSPs for displaying the forms, MultiPart Java API for getting the form input values and files to my servlet and everything is developed in JAVA.

Either by limiting the file size or the limiting the whole request size sent to the servlet.

View 4 Replies View Related

Possible To Re-size Image To Fit Window Size?

Aug 31, 2011

I started learning javascript couple of days ago, so this may be a noobie question.

I wrote a simple code that should re-size the image (there's some other code in here just in case) code...

View 1 Replies View Related

Re-size Image To Fit Window Size?

Aug 31, 2011

I started learning javascript couple of days ago, so this may be a noobie question.

I wrote a simple code that should re-size the image (there's some other code in here just in case) code...

View 4 Replies View Related

How To Get Window Size (not Viewport Size)

Apr 6, 2010

I'd have thought this would be easy but I've been looking for hours and all I can find is info on getting the viewport size, which is normally useful but not in my situation.

In this case I need the actual browser size, including the scrollbars, toolbars, status bars etc. to get an idea of browsers which aren't maximised/full screen and how big they are, and to calculate the amount of the screen taken up by toolbars etc too.

View 3 Replies View Related

Where To Get A Calendar App

Mar 8, 2011

I don't have any knowledge of apps but would like to get one like this and be able to change/add info to it myself.

View 2 Replies View Related

Looking For A Javascript Calendar...

Jul 23, 2005

preferably one that when clicked can update three date dropdowns (day, month, year) like ...

View 19 Replies View Related

How To Pop Up A Restricted Calendar

Jul 23, 2005

I want to popup a calendar (which is not difficult to many developer),
but the difficulty to me is, how to make the user select only on a
particular period, like he/she can only select a date from today to the
date of (today + 10).

View 1 Replies View Related

Calendar And Onchange

May 23, 2007

I have a button that opens a calendar and populates a text box. I use
the onclick event to open the calendar.

Now the textbox has a onChange event that calls a function. The
onChange fires perfectly if I type the date on the textbox, but if the
calendar changes the date on the field then the onChange event doesn't fire.

I even try the following, but it seems that both functions run at the
same time and the value on the field is never picked up.

View 1 Replies View Related

Multiple Calendar Pop Ups?

Apr 26, 2010

I have a page of dates in a form field which currently are being entered manually and wish to have a calendar pop up for each one to make it a bit easier i have managed to use a calendar routine 'tigra calendar' i found online but now after working out not to get it working within my own template i faced the problem on multiple date fields.

i currently use a numbers field 1-10 or how every many there needs to be on that page. but how would i integrate this within the coding from 'tigra calendar' can anyone suggest a better way to do this.

if needed i can sort out a zip file of the files i have for tigra calendar.

View 5 Replies View Related

Clickable Calendar

Jan 10, 2007

Floating, "perpetual" calendar, displaying one month at a time, in a standard calendar grid. Click a date and a form field is populated with mm/dd/yyyy. Populate one or multiple form fields with a single click. May specify up to 7 form fields to populate. Customizations for jumping a number of months/years ahead or behind. Floats to the left hand side or the right hand side. Tested in IE6 & FF1.5.


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Any Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">

/* Copyright 2007, Michael J. Hill. Used with permission. www.javascript-demos.com */
/* Free use of the code, so long as BOTH copyright notices are kept intact */

// Customizations
var defaultMonth = 0; // 1 displays next month onload, -6 displays six months ago
var hopMonths = 6; // number of months to "jump" for Fast Forward and Rewind buttons
var hopYears = 5; // number of years to "jump"
var hiLiteToday = true; // if and when current month is displayed
var floatTo = "right"; // right or left
var clickField = [];//Do not delete this line, the following lines are optional and you may have up to 7 fields
clickField[0] = "contractDate,Order Received"; // fieldName,Description
clickField[1] = "startAssembly,Started Assembly";
clickField[2] = "endAssembly,Finished Assembly";
clickField[3] = "dateShipped,Order Shipped";
// End Customizations

// Do not edit below this line

var IE = false;
if (navigator.appName == "Microsoft Internet Explorer"){IE = true}
var monthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"];
var refDate = "";
var today = "";
var usedToday = "";
var prevField = "";
var leftStr = "";
if (floatTo == "right"){leftStr = (screen.width)-235+"px"}
if (floatTo == "left"){leftStr = "0px"}
if (clickField.length > 0){for (t = 0; t < clickField.length; t++)
{clickField[t] = clickField[t].split(",")}}

function stayHome(){

var nV = 0;
if(!document.body.scrollTop){nV = document.documentElement.scrollTop}
else {nV = document.body.scrollTop}
document.getElementById('nCalendar').style.top = nV+'px'
setTimeout("stayHome()",50);
}

function rewindM(){

refDate = new Date(refDate.getFullYear(),refDate.getMonth()-hopMonths,1)
createCalendar();
}

function forwardM(){

refDate = new Date(refDate.getFullYear(),refDate.getMonth()+hopMonths,1)
createCalendar();
}

function rewindY(){

refDate = new Date(refDate.getFullYear()-hopYears,refDate.getMonth(),1)
createCalendar();
}

function forwardY(){

refDate = new Date(refDate.getFullYear()+hopYears,refDate.getMonth(),1)
createCalendar();
}

function prevM(){

refDate = new Date(refDate.getFullYear(),refDate.getMonth()-1,1)
createCalendar();
}

function nextM(){

refDate = new Date(refDate.getFullYear(),refDate.getMonth()+1,1)
createCalendar();
}

function prevY(){

refDate = new Date(refDate.getFullYear()-1,refDate.getMonth(),1)
createCalendar();
}

function nextY(){

refDate = new Date(refDate.getFullYear()+1,refDate.getMonth(),1)
createCalendar();
}

function fillField(n){

if (usedToday != "" && refDate.getMonth() == today.getMonth() && refDate.getFullYear() == today.getFullYear()){usedToday.style.backgroundColor = "#ffff00"}
if (prevField != "" && prevField != usedToday){prevField.style.backgroundColor = "#ffffe0"}
var fillDate = refDate.getMonth()+1+"/"+n.lastChild.data+"/"+refDate.getFullYear();
fillDate = fillDate.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
for (i = 1; i < clickField.length+1; i++)
{
if (document.getElementById('fieldBox'+i).checked)
{
document.forms[0][clickField[i-1][0]].value = fillDate;
document.getElementById('fieldBox'+i).checked = false;
if (n.style.backgroundColor == '#ffff00'){usedToday = n}
if (n.style.backgroundColor == 'rgb(255, 255, 0)'){usedToday = n}
n.style.backgroundColor = "#90ee90";
prevField = n;
}
}
}

function createCalendar(){

document.getElementById('header').lastChild.data = monthNames[refDate.getMonth()]+" "+refDate.getFullYear();
var currEOM = new Date(refDate.getFullYear(),refDate.getMonth()+1,refDate.getDate()-refDate.getDate()).getDate();
var pageMap = document.getElementById('monthPage');
for (i=2; i<8; i++)
{
for (n=0; n<7; n++)
{
if (IE){pageMap.rows[i].cells[n].lastChild.data = " "}
else {pageMap.rows[i].cells[n].lastChild.data = "-"}
pageMap.rows[i].cells[n].style.backgroundColor = "#ffffe0";
pageMap.rows[i].cells[n].style.cursor = "auto";
}
}
var counter = 0;
var startDay = new Date(refDate.getFullYear(),refDate.getMonth(),1).getDay();
for (i=2; i<8; i++)
{
for (n=0; n<7; n++)
{
if (i == 2 && n >= startDay)
{
counter++;
pageMap.rows[i].cells[n].lastChild.data = counter;
pageMap.rows[i].cells[n].onclick = function(){fillField(this)}
pageMap.rows[i].cells[n].style.cursor = "pointer";
}
if (i > 2 && i < 6)
{
counter++;
pageMap.rows[i].cells[n].lastChild.data = counter;
pageMap.rows[i].cells[n].onclick = function(){fillField(this)}
pageMap.rows[i].cells[n].style.cursor = "pointer";
}
if (i == 6 && counter < currEOM)
{
counter++;
pageMap.rows[i].cells[n].lastChild.data = counter;
pageMap.rows[i].cells[n].onclick = function(){fillField(this)}
pageMap.rows[i].cells[n].style.cursor = "pointer";
}
if (i == 7 && counter < currEOM)
{
document.getElementById('lastRow').style.display = "";
counter++;
pageMap.rows[i].cells[n].lastChild.data = counter;
pageMap.rows[i].cells[n].onclick = function(){fillField(this)}
pageMap.rows[i].cells[n].style.cursor = "pointer";
}
if (IE && i == 7)
{
if (pageMap.rows[i].cells[0].lastChild.data == " ")
{document.getElementById('lastRow').style.display = "none"}
}
if (!IE && i == 7)
{
if (pageMap.rows[i].cells[0].lastChild.data == "-")
{document.getElementById('lastRow').style.display = "none"}
}
}
}
if (today.getFullYear() == refDate.getFullYear() && today.getMonth() == refDate.getMonth() && hiLiteToday)
{
for (i=2; i<8; i++)
{
for (n=0; n<7; n++)
{
var tmp = pageMap.rows[i].cells[n].lastChild.data;
if (tmp == today.getDate())
{pageMap.rows[i].cells[n].style.backgroundColor = "#FFFF00"}
}
}
}
}

function insertRow(){

var isTable = document.getElementById('clickFields')
var index = isTable.rows.length;
var nextRow = isTable.insertRow(index);
var isBox = nextRow.insertCell(0);
var isDesc = nextRow.insertCell(1);
var idStr = "fieldBox"+index;
isBox.innerHTML = "<input type='checkbox' id="+idStr+">";
isBox.style.width = "20px";
isDesc.innerHTML = clickField[index-1][1];
}

function buildClickFields(){

if (clickField.length == 0)
{
document.getElementById('clickNotice').style.display = "none";
document.getElementById('clickFields').style.display = "none";
}
else {
for (r = 0; r <clickField.length; r++)
{insertRow()}
}
}

function buildSupport(){

var styleStr = "<style type='text/css'>.left {border-left:solid black 1px;border-right:solid black 1px;border-bottom:solid black 1px;text-align:center;width:27px}.other {border-right:solid black 1px;border-bottom:solid black 1px;text-align:center;width:27px}.btn {font-size:6pt;font-weight:bold;width:22px}.day {border-right:solid black 1px;border-bottom:solid black 1px;text-align:center;width:27px;font-family:arial;font-size:10pt;font-weight:bold}.leftDay {border-left:solid black 1px;border-right:solid black 1px;border-bottom:solid black 1px;text-align:center;width:27px;font-family:arial;font-size:10pt;font-weight:bold}</style>"
var tableStr = "<DIV id=nCalendar style='POSITION: absolute; TOP: 0px'><TABLE id=holder style='MARGIN: 10px; BACKGROUND-COLOR: #ffffe0' cellSpacing=0 cellPadding=0 align=center><TBODY><TR><TD><TABLE id=monthPage style='FONT-SIZE: 14pt' cellSpacing=0 cellPadding=3 width=189 border=0><TBODY><TR><TH id=header style='BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: times; BACKGROUND-COLOR: #ffe4b5' colSpan=7>&nbsp;</TH></TR><TR style='BACKGROUND-COLOR: #f0e68c'><TD class=leftDay>S</TD><TD class=day>M</TD><TD class=day>T</TD><TD class=day>W</TD><TD class=day>T</TD><TD class=day>F</TD><TD class=day>S</TD></TR><TR><TD class=left>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD></TR><TR><TD class=left>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD></TR><TR><TD class=left>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD></TR><TR><TD class=left>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD></TR><TR><TD class=left>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD></TR><TR id=lastRow style='DISPLAY: none'><TD class=left>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD><TD class=other>&nbsp;</TD></TR><TR><TD style='BORDER-RIGHT: black 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 12pt; PADDING-BOTTOM: 5px; BORDER-LEFT: black 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #87ceeb' align='center' colSpan=7><INPUT class=btn id=rwMonths onclick=rewindM() type=button value='<<'>&nbsp; <INPUT class=btn title=Previous onclick=prevM() type=button value='<'>&nbsp;Month&nbsp; <INPUT class=btn title=Next onclick=nextM() type=button value='>'>&nbsp; <INPUT class=btn id=fwMonths onclick=forwardM() type=button value='>>'> </TD></TR><TR><TD style='BORDER-RIGHT: black 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 12pt; PADDING-BOTTOM: 5px; BORDER-LEFT: black 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: black 1px solid; BACKGROUND-COLOR: #87ceeb' align='center' colSpan=7><INPUT class=btn id=rwYears onclick=rewindY() type=button value='<<'>&nbsp; <INPUT class=btn title=Previous onclick=prevY() type=button value='<'><SPAN style='LETTER-SPACING: 1px'>&nbsp;&nbsp;Year</SPAN>&nbsp;&nbsp; <INPUT class=btn title=Next onclick=nextY() type=button value='>'>&nbsp; <INPUT class=btn id=fwYears onclick=forwardY() type=button value='>>'> </TD></TR><TR id=clickNotice><TH style='BORDER-RIGHT: black 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: black 1px solid; FONT-FAMILY: arial; BACKGROUND-COLOR: #90ee90' colSpan=7>Click To Field: </TH></TR></TBODY><TABLE id=clickFields style='BORDER-RIGHT: black 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: black 1px solid; WIDTH: 189px; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: arial; BACKGROUND-COLOR: #7fffd4' cellSpacing=0 cellPadding=0><TBODY><TR></TR></TBODY></TABLE></TR></TBODY></TABLE></TD></TBODY></TABLE></DIV>"

document.write(styleStr);
document.write(tableStr);
}

function initCalendar(){

buildSupport();
document.getElementById('rwMonths').title = " -"+hopMonths+" ";
document.getElementById('fwMonths').title = " +"+hopMonths+" ";
document.getElementById('rwYears').title = " -"+hopYears+" ";
document.getElementById('fwYears').title = " +"+hopYears+" ";
today = new Date();
refDate = new Date(today.getFullYear(),today.getMonth()+defaultMonth,1)
createCalendar();
buildClickFields();
document.getElementById('nCalendar').style.left = leftStr;
stayHome();
}

</script>
<style type="text/css">

body {background-color:#eae3c6;margin-top:60px}
form {width:260px;height:1200px;margin:auto}
fieldset {width:260px;background-color:#f0fff0;border:1px solid #87ceeb}
legend {font-family:tahoma;font-size:10pt;font-weight:bold;color:#00008b;background-color:#87ceeb;padding-left:3px;padding-right:3px;margin-bottom:5px;letter-spacing:+1px}
label {font-family:times;font-size:12pt;color:#00008b;padding:5px}
.dates {font-family:times;font-size:10pt;text-align:right}

</style>
</head>
<body>

<form method='post' action=''>
<fieldset>
<legend> Order Tracking </legend>
<label> Order Received <input type='text' size=&#399;' name='contractDate' class='dates' readonly></label><br>
<label> Started Assembly <input type='text' size=&#399;' name='startAssembly' class='dates' readonly></label><br>
<label> Finished Assembly <input type='text' size=&#399;' name='endAssembly' class='dates' readonly></label><br>
<label> Order Shipped <input type='text' size=&#399;' name='dateShipped' class='dates' readonly></label>
</fieldset>
</form>
<div style='margin-left:auto;margin-right:auto;text-align:center;font-size:8pt;padding:3px'>Click to Field Calendar, &copy; Copyright 2007, Michael J. Hill. Used with permission. <a href='http://www.javascript-demos.com'>www.javascript-demos.com</a></div>

<!-- Keep the following line as the LAST line in the Body -->
<script type="text/javascript"> initCalendar() </script>
</body>
</html>

View 4 Replies View Related

Small Calendar

May 15, 2006

I wanted a small calendar for a web page that is created for the current month and highlights the current day and a date passed in. I also added a variable to show text when the cursor is over the highlighted dates. It's nothing special, but I like it and thought I'd share it. Here is the code and it is attached for downloading as well.

Let me know what you think of it.

<html>
<head>
<title>Calendar</title>
<script type="text/javascript">

var month = ["January","February","March","April","May","June","July","August","September","October","November","December"];
var moDays= [31,28,31,30,31,30,31,31,30,31,30,31];

function display(d,txt) {

var highlightDate = new Date(Date.parse(d));
var flag = false;

var startDate = new Date();
startDate.setDate(1);

if (new Date(startDate.getFullYear(),1,29).getDate() == 29) moDays[1] = 29;

var endDate = new Date();
endDate.setDate(moDays[endDate.getMonth()]);

if (highlightDate >= startDate && highlightDate <= endDate) flag = true;
if (!txt) txt = "";

var start = 0 - startDate.getDay();
var end = endDate.getDate() + (7 - endDate.getDay());

var r = document.getElementById('calendar').insertRow(0);

for (i = start; i < end; i++) {
if ((i - start - 1) % 7 == 0 && i != start) {
r = document.getElementById('calendar').insertRow(-1);
r.className = 'newRow'
}

var c = r.insertCell(-1);
if (i > 0 && i <= endDate.getDate()) {
c.innerHTML = i;
if (i == new Date().getDate()) {
c.title = 'Today'
c.className = 'selectedCell'
} else {
c.className = 'newCell'
}
if (flag && i == highlightDate.getDate()) {
c.title = txt;
c.className += ' highlightedCell'
}
} else {
c.innerHTML = '&nbsp;'
c.className = 'hiddenCell'
}
}
var title = document.getElementById('calendar').rows[0].cells[0];
title.innerHTML = month[startDate.getMonth()] + ' ' + startDate.getFullYear();
title.colSpan = 7;
title.className = 'title'
}

</script><style type="text/css">
#calendar {
position: absolute;
color: navy;
font: italic 75% sans-serif;
margin: 2px;
padding: 1px;
background-color: lightcyan;
border: 1px solid gray;
}
TR.newRow {
background-color: white;
}
TD.newCell {
text-align: right;
margin: 1px;
padding: 2px;
border-right: 1px solid lightskyblue;
border-bottom: 1px solid lightskyblue;
}
TD.selectedCell {
background-color: cyan;
text-align: right;
margin: 1px;
padding: 2px;
border-right: 1px solid lightskyblue;
border-bottom: 1px solid lightskyblue;
}
TD.hiddenCell {
background-color: lightcyan;
}
TD.title {
font: bold 110% sans-serif;
text-align: center;
border-bottom: 1px solid skyblue;
}
TD.highlightedCell {
background-color: palegoldenrod;
}
</style>
</head>

<body onload="display(&#3905;/25/2006','Adam's Birthday');">

<table id="calendar"></table>

</body>

</html>

View 1 Replies View Related

JQuery :: Changing MM/DD/YY To DD/MM/YY With Calendar?

Feb 10, 2011

I have this code working fine but need to switch the formatting from MM/DD/YY to DD/MM/YY.

How would I do this??

<script>
$(function() {
$('#date1').datepicker();
setMinDate(); // Set it now

[Code]......

View 10 Replies View Related

JQuery :: How To Add Calendar To Textbox

Nov 11, 2011

I am trying to embed a calendar into my customers pages - the JS, CSS and jQuery are held on my server, so to allow my customers to just have to add one line of code, the link I give them, links to a JS file, which then dynamically loads the other files required, then adds a textbox, dropdown and button to the BOM, using document.write. However, to add the jQuery calendar to the textbox, I have to be sure jQuery has loaded. If it hasn't, by the time the page script hits the $( to check for jQuery, if it hasn't loaded, all of the jQuery is ignored. How can I get the script to stop and wait (without having the customer having to press a button)?

So I give my customers this one line:
<script src="[URL]" language="javascript" type="text/javascript"></script>

The mt.js file contains...
//JS to load files
function loadjscssfile(filename, filetype) {
if (filetype == "js") { //if filename is a external JavaScript file
var fileref = document.createElement('script')
fileref.setAttribute("type", "text/javascript")
fileref.setAttribute("src", filename)
}else if (filetype == "css") { //if filename is an external CSS file
var fileref = document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", filename)
}
if (typeof fileref != "undefined")
document.getElementsByTagName("head")[0].appendChild(fileref)
}
loadjscssfile("[URL]", "css");
loadjscssfile("[URL]", "js");
loadjscssfile("[URL]", "js");
//write GUI to DOM
document.write("<input id="calendar" type="text" />");
document.write("<input id="btnCheck" type="button" value="Check" />");
document.write("<br /><div id="result" />");
//Jquery to add calendar to textbox added above
$(function () {
$("#calendar").datepicker({
showOn: "button",
....
....
});

So if the jQuery/UI/CSS hasn't loaded, the script will get here, without having added the jQuery calendar to the textbox.

View 3 Replies View Related

JQuery :: Calendar Not Working In IE8?

Oct 25, 2011

My project is using Jquery calendar..and it works fine in Chrome,IE 7.But its not working in IE 8,means we are able to see the calendar..but not able to input the date..

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved