View Full Version : JQuery Content Load

11-29-2008, 12:20 AM
Hey i wrote this code to load content without page loads.

I'm using the JQuery framework and im still quite new to it.

is it possible to fade the content in an out somehow.

<script type="text/javascript" >
$('li.home').click(function() {
$('li.about').click(function() {
$('li.products').click(function() {
$('li.tech').click(function() {
$('li.palette').click(function() {
$('li.contact').click(function() {


The two things i tried were this:

$('li.home').click(function() {


$('li.home').click(function() {

Im still learning the syntax properly
hopefully someone can help :)

Thanks in advance

03-29-2010, 12:19 AM
Hi mate ill leave a simple code

In your Body:

<ul id="nav">
<li><a href="home.php">Go to home</a></li>
<li><a href="hello.php">Contact Me</a></li>
<li><a href="portafolio.php">My Work</a></li>

After your JQuery file:

<script type="text/javascript">
$("#nav a").each(function(){ // Where the function must work on
var href = $(this).attr("href");
$("#show").hide().load(href).fadeIn("slow"); //A Nice Fadein Effect
$(this).attr({ href: "#"}); //#show is the Div who loads the content

I hope it helps.

03-04-2011, 05:50 PM
i've found Your code through google search and i find very easy and well working :)
I'm a noob in jquerry stuff, and i'm using ready to go scripts.
I'have a question, is there a way to combine Yours script with another?

I'd like to add this script: http://jscrollpane.kelvinluck.com/ which changes the look of scrollbars to Yours, wchich loads pages nicely :)

I think that Your script shuold call the other script at some moment, but i don't know when :) I tried to put
$('.tresc').jScrollPane(); in Your script, but it doesn't work :(

'.tresc' is my class for div that shows content.

Is there any way to combine them?