Skip to content

Commit

Permalink
Moved <style> above <script>.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathansmith committed May 16, 2011
1 parent d7fe259 commit 5baafb1
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 75 deletions.
84 changes: 42 additions & 42 deletions test_class.html
Expand Up @@ -3,48 +3,6 @@
<head>
<meta charset="utf-8" />
<title>Adapt.js - HTML Class Test</title>
<script>
// Called by Adapt.js
function myCallback(i, width) {
// Alias HTML tag.
var html = document.documentElement;

// Find all instances of range_NUMBER and kill 'em.
html.className = html.className.replace(/(\s+)?range_\d/g, '');

// Check for valid range.
if (i > -1) {
// Add class="range_NUMBER"
html.className += ' range_' + i;
}

// Note: Not making use of width here, but I'm sure
// you could think of an interesting way to use it.
}

// Edit to suit your needs.
var ADAPT_CONFIG = {
// false = Only run once, when page first loads.
// true = Change on window resize and page tilt.
dynamic: true,

// Optional callback... myCallback(i, width)
callback: myCallback,

// First range entry is the minimum.
// Last range entry is the maximum.
// Separate ranges by "to" keyword.
range: [
'0 to 760',
'760 to 980',
'980 to 1280',
'1280 to 1600',
'1600 to 1920',
'1920'
]
};
</script>
<script src="assets/js/adapt.min.js"></script>
<style>

* {
Expand Down Expand Up @@ -88,6 +46,48 @@
display: block;
}
</style>
<script>
// Called by Adapt.js
function myCallback(i, width) {
// Alias HTML tag.
var html = document.documentElement;

// Find all instances of range_NUMBER and kill 'em.
html.className = html.className.replace(/(\s+)?range_\d/g, '');

// Check for valid range.
if (i > -1) {
// Add class="range_NUMBER"
html.className += ' range_' + i;
}

// Note: Not making use of width here, but I'm sure
// you could think of an interesting way to use it.
}

// Edit to suit your needs.
var ADAPT_CONFIG = {
// false = Only run once, when page first loads.
// true = Change on window resize and page tilt.
dynamic: true,

// Optional callback... myCallback(i, width)
callback: myCallback,

// First range entry is the minimum.
// Last range entry is the maximum.
// Separate ranges by "to" keyword.
range: [
'0 to 760',
'760 to 980',
'980 to 1280',
'1280 to 1600',
'1600 to 1920',
'1920'
]
};
</script>
<script src="assets/js/adapt.min.js"></script>
</head>
<body>
<p>
Expand Down
66 changes: 33 additions & 33 deletions test_id.html
Expand Up @@ -3,39 +3,6 @@
<head>
<meta charset="utf-8" />
<title>Adapt.js - HTML ID Test</title>
<script>
// Called by Adapt.js
function myCallback(i, width) {
// Replace HTML tag's ID.
document.documentElement.id = 'range_' + i;

// Note: Not making use of width here, but I'm sure
// you could think of an interesting way to use it.
}

// Edit to suit your needs.
var ADAPT_CONFIG = {
// false = Only run once, when page first loads.
// true = Change on window resize and page tilt.
dynamic: true,

// Optional callback... myCallback(i, width)
callback: myCallback,

// First range entry is the minimum.
// Last range entry is the maximum.
// Separate ranges by "to" keyword.
range: [
'0 to 760',
'760 to 980',
'980 to 1280',
'1280 to 1600',
'1600 to 1920',
'1920'
]
};
</script>
<script src="assets/js/adapt.min.js"></script>
<style>

* {
Expand Down Expand Up @@ -79,6 +46,39 @@
display: block;
}
</style>
<script>
// Called by Adapt.js
function myCallback(i, width) {
// Replace HTML tag's ID.
document.documentElement.id = 'range_' + i;

// Note: Not making use of width here, but I'm sure
// you could think of an interesting way to use it.
}

// Edit to suit your needs.
var ADAPT_CONFIG = {
// false = Only run once, when page first loads.
// true = Change on window resize and page tilt.
dynamic: true,

// Optional callback... myCallback(i, width)
callback: myCallback,

// First range entry is the minimum.
// Last range entry is the maximum.
// Separate ranges by "to" keyword.
range: [
'0 to 760',
'760 to 980',
'980 to 1280',
'1280 to 1600',
'1600 to 1920',
'1920'
]
};
</script>
<script src="assets/js/adapt.min.js"></script>
</head>
<body>
<p>
Expand Down

0 comments on commit 5baafb1

Please sign in to comment.