Question: Calling JQuery and plugins?
I am diving into javascript and I am attempting to use:
JQuery
and CrossSlide
I have created test.html to get to know javascript better. However I seem to not be calling these scripts correctly.
Can you review the code below and tell me where I am messing up? Thank you, I am usually quick to pick up on things and always eager to learn!
---
<html>
<head>
<script src='jsparty/jquery.js' type='text/javascript'></script>
<script type='text/javascript'>//<![CDATA[
$(function() {
if ($.browser.ie && $.browser.version < 8)
$('<span>►</span>').prependTo('kbd');
if ($.browser.ie && $.browser.version < 7 || $.browser.safari && $.browser.version < 600)
$('#menu a').hover(function() {
$(this).next().show();
}, function() {
$(this).next().hide();
});
});
//]]></script>
</head>
<body>
<script src='jsparty/jquery.cross-slide.js' type='text/javascript'></script>
<script type='text/javascript'>//<![CDATA[
function displaySource(name) {
$('<pre>'
+ $('#source-' + name).html() // $(<script>).text() is broken on IE 5
.replace(/^\s*|\s*$/g, '')
.split('\n').slice(2, -2).join('\n')
.replace(/( \/\/.*)/g, '<i>$1</i>')
+ '</pre>')
.insertAfter('#display-' + name);
}
//]]></script>
<script type='text/javascript' id='source-test1'>//<![CDATA[
$(function() {
$('#test1').crossSlide({
speed: 45, //in px/sec
fade: 1 //in sec
}, [
{ src: ' dir: 'up' },
{ src: ' dir: 'down' },
{ src: ' dir: 'up' },
{ src: ' dir: 'down' }
]);
});
//]]></script>
</body>
</html>
I am diving into javascript and I am attempting to use:
JQuery
and CrossSlide
I have created test.html to get to know javascript better. However I seem to not be calling these scripts correctly.
Can you review the code below and tell me where I am messing up? Thank you, I am usually quick to pick up on things and always eager to learn!
---
<html>
<head>
<script src='jsparty/jquery.js' type='text/javascript'></script>
<script type='text/javascript'>//<![CDATA[
$(function() {
if ($.browser.ie && $.browser.version < 8)
$('<span>►</span>').prependTo('kbd');
if ($.browser.ie && $.browser.version < 7 || $.browser.safari && $.browser.version < 600)
$('#menu a').hover(function() {
$(this).next().show();
}, function() {
$(this).next().hide();
});
});
//]]></script>
</head>
<body>
<script src='jsparty/jquery.cross-slide.js' type='text/javascript'></script>
<script type='text/javascript'>//<![CDATA[
function displaySource(name) {
$('<pre>'
+ $('#source-' + name).html() // $(<script>).text() is broken on IE 5
.replace(/^\s*|\s*$/g, '')
.split('\n').slice(2, -2).join('\n')
.replace(/( \/\/.*)/g, '<i>$1</i>')
+ '</pre>')
.insertAfter('#display-' + name);
}
//]]></script>
<script type='text/javascript' id='source-test1'>//<![CDATA[
$(function() {
$('#test1').crossSlide({
speed: 45, //in px/sec
fade: 1 //in sec
}, [
{ src: ' dir: 'up' },
{ src: ' dir: 'down' },
{ src: ' dir: 'up' },
{ src: ' dir: 'down' }
]);
});
//]]></script>
</body>
</html>