Skip to content

Instantly share code, notes, and snippets.

View jakearchibald's full-sized avatar
💭
Tired

Jake Archibald jakearchibald

💭
Tired
View GitHub Profile
glow.ready(function() {
var myPanel = new glow.widgets.Panel("#formPanel");
//display panel
myPanel.show();
})
glow.ready(function() {
// create your panel, this will take it off the page
// the form must have id="form" for the below to work
var myPanel = new glow.widgets.Panel("#form");
// listen for clicks on the "Enquire Now!" button
// The "Enquire Now!" button must have id="enquireNow"
glow.events.addListener('#enquireNow', 'click', function() {
// show the panel
myPanel.show();
<div id="panel1">
<p>This is my first Panel</p>
</div>
<div id="panel2">
<p>This is my second Panel</p>
</div>
<p><a href="#" id="showFirstPanel">Show first panel</a></p>
<p><a href="#" id="showSecondPanel">Show second panel</a></p>
glow.events.addListener(theForm, 'submit', function() {
// do your ajax stuff here
// prevent the form submitting
return false;
});
return (
a[2] < b[0] ? 0 :
b[2] < a[0] ? 0 :
a[0] < b[0] ? (a[2] < b[2] ? a[2] - b[0] : b[2] - b[0]) :
b[2] < a[2] ? b[2] - a[0] : a[2] - a[0]
) * (
a[1] < b[3] ? 0 :
b[1] < a[3] ? 0 :
a[3] < b[3] ? (a[1] < b[1] ? a[1] - b[3] : b[1] - b[3]) :
b[1] < a[1] ? b[1] - a[3] : a[1] - a[3]
glow.events.addListener(theForm, 'submit', function() {
// do your ajax stuff here
// prevent the form submitting
return false;
});
<script type="text/javascript">
(function() {
var glow;
gloader.load(
["glow", "1", "glow.widgets.Panel"],
{
async: true,
onLoad: function(g) {
glow = g;
new glow.widgets.Timetable(container, startTime, endTime, viewStartTime, viewEndTime, {
// timetable options
tracks: [
// add an array for each track like this...
[trackTitle, trackSize, {
// track options
items: [
// add an array like this for each item
[title, startTime, endTime, opts]
]
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
Function.prototype.delay = function(ms, obj) {
setTimeout(function() {
this.call(obj);
}, ms)
}