mirror of https://github.com/dyne/webnomad.git
dropdown select for design test
This commit is contained in:
parent
547c493c92
commit
ae4f0bf23b
|
|
@ -1,32 +0,0 @@
|
||||||
$(document).ready(function() {
|
|
||||||
|
|
||||||
function change_size(element, size) {
|
|
||||||
|
|
||||||
var current = parseInt(element.css('font-size'));
|
|
||||||
|
|
||||||
if (size == 'smaller') {
|
|
||||||
var new_size = current - 1;
|
|
||||||
} else if (size == 'bigger') {
|
|
||||||
var new_size = current + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
element.css('font-size', new_size + 'px');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#smaller').click(function() {
|
|
||||||
change_size($('p'), 'smaller');
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#bigger').click(function() {
|
|
||||||
change_size($('p'), 'bigger');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
function change_family(element, family) {
|
|
||||||
console.log('change font family');
|
|
||||||
element.css('font-family', family);
|
|
||||||
|
|
||||||
}
|
|
||||||
24
test
24
test
|
|
@ -53,6 +53,8 @@ EOF
|
||||||
# start the body of article
|
# start the body of article
|
||||||
cat <<EOF >> $dst
|
cat <<EOF >> $dst
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
<a id="menu" href="#sidr">Design test</a>
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
@ -66,20 +68,25 @@ cat <<EOF >> $dst
|
||||||
|
|
||||||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||||||
<script type="text/javascript" src="js/jquery.sidr.js"></script>
|
<script type="text/javascript" src="js/jquery.sidr.js"></script>
|
||||||
<script type="text/javascript" src="js/jquery.fontswitch.js"></script>
|
|
||||||
|
|
||||||
<a id="menu" href="#sidr">Design test</a>
|
|
||||||
|
|
||||||
<div id="sidr">
|
<div id="sidr">
|
||||||
<h2>Design test</h2>
|
<h2>Design test</h2>
|
||||||
<h3>Font size</h3>
|
<h3>Font size</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#" id="smaller">smaller</a><li><a href="#" id="bigger">bigger</a></li>
|
<li><select id="h1size" name="size">
|
||||||
|
<option value="2">2</option>
|
||||||
|
<option value="4">4</option>
|
||||||
|
<option value="6">6</option>
|
||||||
|
</select></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>Font family</h3>
|
<h3>Font family</h3>
|
||||||
<ul>
|
<select id="headerfamily" name="header font family">
|
||||||
<li><a href="#" id="h1courier">Courier</a></li>
|
<option value="Arial">Arial</option>
|
||||||
</ul>
|
<option value="Courier">Courier</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -90,8 +97,8 @@ cat <<EOF >> $dst
|
||||||
displace: false
|
displace: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
\$('#h1size').change(function() { \$('h1').css('font-size', \$('#h1size').val() + "em" ); })
|
||||||
\$('#h1courier').click(function(){ change_family(\$('h1'), 'Courier'); })
|
\$('#headerfamily').change(function(){ \$('h1').css('font-family', \$('#headerfamily').val() ); })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
@ -113,4 +120,3 @@ done
|
||||||
mkdir -p test/js
|
mkdir -p test/js
|
||||||
cp $DIR/js/jquery.min.js test/js
|
cp $DIR/js/jquery.min.js test/js
|
||||||
cp $DIR/js/jquery.sidr.js test/js
|
cp $DIR/js/jquery.sidr.js test/js
|
||||||
cp $DIR/js/jquery.fontswitch.js test/js
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue