Page 1 of 1

Javascript {literal}

Posted: Mon Aug 23, 2010 7:55 pm
by Keithb
I have a js slider that I'm using in a template and the next/previous isn't displayed, and firefox keeps shouting that $ is undefined with the $(function() line;

Code: Select all

 {literal} <!-- Site JavaScript -->
                <__script__ type="text/javascript" src="js/jquery-1.3.1.min.js"></__script>
                <__script__ type="text/javascript" src="js/jquery.easing.1.3.js"></__script>
                <__script__ type="text/javascript" src="js/jquery.ennui.contentslider.js"></__script>
                <__script__ type="text/javascript">
                    $(function() {
                    $('#one').ContentSlider({
                    width : '920px',
                    height : '200px',
                    speed : 800,
                    easing : 'easeInOutBack'
                    });
                    });
                </__script>
                 {/literal}
I added the {literal} but it doesn't appear to help.  This code is in the body of the template.  Am I doing something wrong?

Re: Javascript {literal}

Posted: Tue Aug 24, 2010 11:32 am
by spike
Okay so that's the code you're using in the template presumably before the last body tag.
What's the code you're using on the actual page ?

see here:
http://ennuidesign.com/demo/contentslider/#
go to view source.

Re: Javascript {literal}

Posted: Tue Aug 24, 2010 12:49 pm
by Keithb
This code would be part of every page, and is in the static template.  The individual page doesn't have any javascript in it unless that is not what you are referring to.  I may have some css and path problems for images also.

Re: Javascript {literal}

Posted: Tue Aug 24, 2010 1:00 pm
by Keithb
After looking at my source, I only see:

Code: Select all

<__script__ type="text/javascript">
                    $(function() );
                    });
                </__script>
It's dropping the other info for some reason.  Newbie problems I presume.

Re: Javascript {literal}

Posted: Tue Aug 24, 2010 1:19 pm
by nuno

Code: Select all

<!-- Site JavaScript -->
                <__script__ type="text/javascript" src="js/jquery-1.3.1.min.js"></__script>
                <__script__ type="text/javascript" src="js/jquery.easing.1.3.js"></__script>
                <__script__ type="text/javascript" src="js/jquery.ennui.contentslider.js"></__script>
              {literal}
                <__script__ type="text/javascript">
                   $(document).ready(function() {
                    $('#one').ContentSlider({
                    width : '920px',
                    height : '200px',
                    speed : 800,
                    easing : 'easeInOutBack'
                    });
                    });
                </__script>
                 {/literal}
UPDATE:
http://www.learningjquery.com/2006/09/i ... ment-ready