Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-22-2010, 03:49 PM   PM User | #1
earth2mac
New Coder

 
Join Date: Jun 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
earth2mac is an unknown quantity at this point
jquery or javascript - link color only changes on focus link?

i want the link only to change color when clicked and content changes in window "#gallery". Then when click on another link, it goes back to original color and new link is now changed. Basically, only when link is acitve or focused on then it's new color so user knows link and content that's being viewed. Here is code for head:
<script type="text/javascript">
$(document).ready(function() {
$('#links a').click(function() {
var url=$(this).attr('href');
$('#gallery').load(url + ' #newsItems');
return false;
});
});
</script>

here is code body:

<!-- BEGIN MAIN CONTENT -->
<ul id="links">
<li class="active"><a href="faqsAnswer_01.html">Which are the safari countries?</a></li>
<li><a href="faqsAnswer_02.html">Best country for safari?</a></li>
<li><a href="faqsAnswer_03.html">Best season for safari?</a></li>
<li><a href="faqsAnswer_04.html">Is safari &ldquo;roughing it?&rdquo;</a></li>

<li><a href="faqsAnswer_05.html">Cost of a typical safari?</a></li>
<li><a href="faqsAnswer_06.html">Do I have enough vacation time?</a></li>
<li><a href="faqsAnswer_07.html">Do I have to get shots?</a></li>
<li><a href="faqsAnswer_08.html">Is Africa always hot?</a></li>
<li><a href="faqsAnswer_09.html">Will I be eating bugs?</a></li>
<li><a href="faqsAnswer_10.html">Will bugs be eating me?</a></li>

<li><a href="faqsAnswer_11.html">Am I safe in Africa?</a></li>
<li><a href="faqsAnswer_12.html">Who should go on safari?</a></li>
</ul>
<!-- END MAIN CONTENT -->
</div>

<!-- BEGIN WINDOW CONTENT -->
<div id="gallery">
<img src="images/elephant.jpg" alt="elephant" width="270" height="340" />
</div>

<!-- END WINDOW CONTENT -->
earth2mac is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:37 AM.


Advertisement
Log in to turn off these ads.