...

View Full Version : Question: Calling JQuery and plugins?



MMOgrl
11-18-2008, 11:26 PM
Question: Calling JQuery and plugins?

I am diving into javascript and I am attempting to use:

JQuery
http://jquery.com/

and CrossSlide
http://www.gruppo4.com/~tobia/cross-slide.shtml

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: 'http://icanhascheezburger.files.wordpress.com/2007/04/oh-hi-i-losted-yr-page-lulz2.jpg', dir: 'up' },
{ src: 'http://www.gruppo4.com/~tobia/lib/sunflower.jpeg', dir: 'down' },
{ src: 'http://www.gruppo4.com/~tobia/lib/flip-flops.jpeg', dir: 'up' },
{ src: 'http://www.gruppo4.com/~tobia/lib/rubber-ring.jpeg', dir: 'down' }
]);
});
//]]></script>

</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum