Forums

jQuery? (2 posts)

  1. spiralingbob
    Member
    Posted 3 months ago #

    Hi everyone,

    I am trying to use a jQuery script to allow customizable scroll bars on my site. I can not get it to work! I tried the script in a regular HTML page, and it works fine. But when I try to implement in Wordpress, it doesn't work at all. Here is the code I use in my HTML, in the "head" section:

    <link rel="stylesheet" type="text/css" media="all" href="styles/jScrollPane.css" />
    		<script type="text/javascript" src="scripts/jquery-1.3.2.js""></script>
    		<script type="text/javascript" src="scripts/jquery.mousewheel.js"></script>
    		<script type="text/javascript" src="scripts/jScrollPane.js"></script>
    		<!--script type="text/javascript" src="../dist/jScrollPane.min.js"></script-->
    		<script type="text/javascript">
    
    			$(function()
    			{
    				// this initialises the demo scollpanes on the page.
    				$('#pane1').jScrollPane();
    				$('#pane2').jScrollPane({showArrows:true});
    				$('#pane3, #pane4').jScrollPane({scrollbarWidth:20, scrollbarMargin:10});
    
    				// this allows you to click a link to add content to #pane4 and shows how to
    				// reinitialise the scrollbars when you have done this.
    				$('#add-content').bind(
    					'click',
    					function()
    					{
    						$('#pane4').append($('<p></p>').html($('#intro').html())).jScrollPane({scrollbarWidth:20, scrollbarMargin:10});
    					}
    				);
    				// and this allows you to click the link to reduce the amount of content in
    				// #pane4 and reinitialise the scrollbars.
    				$('#remove-content').bind(
    					'click',
    					function()
    					{
    						$('#pane4').empty().append($('<p></p>').html($('#intro').html())).jScrollPane({scrollbarWidth:20, scrollbarMargin:10});
    					}
    				);
    			});
    
    		</script>
    	<script src="/mint/?js" type="text/javascript"></script>

    Does anyone have any ideas on what I can do to make this work in Wordpress? I've been reading countless articles about JQuery and Wordpress, and I can't seem to grasp it. Apparently, Wordpress already comes with JQuery included, and you have to call for the scripts in a different way?

    Maybe someone can walk me through this, and tell me where and what to insert in my header.php file? And maybe also tell me if I need to upload my .js files to a specific place?

    Thanks!

    The URL of my site-in-progress is http://www.bobhartmusic.com/arrow

  2. saraswati11
    Member
    Posted 1 month ago #

    Hi,

    I see you got that to work? Anyway you can explain how you do it. I can figure it out for the life of me.

    Thanks

Reply

You must log in to post.

About this Topic