TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-23-2009, 10:09 AM   #1 (permalink)
The Acquainted
 
Hightower's Avatar
 
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
Hightower is on a distinguished road
Default Help with jQuery

I've just started looking at JQuery today and I have made the following 'simple' script to play with:

html4strict Code:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <script src="jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $('#hidefixtures').click(function(event){
                event.preventDefault();
                $('#fixtures').slideUp("slow");
            });
        }); 
    </script>
</head>
<body>
<div id="hidefixtures">
    <a href="">Hide/Show</a>
</div>

<div id="fixtures">
    <table width="200px" border="1px" cellpadding="3px">
        <tr>
            <td align="center" colspan="3">Date</td>
        </tr><tr>
            <td>Home team</td>
            <td>v</td>
            <td>Away team</td>
        </tr>
    <table>
</div>

<div>
    <a href="">Hide/Show something else</a>
</div>
</body>
</html>

Basically there are three elements. 1 & 3 are little links. I want element 2 to be hidden when element 1 is clicked, and then reshown when element 1 is clicked again.

This is the first time I have looked at JQuery (or any kind of JScript) so any help would be appreciated.

With the script at the minute, it hides element 2 but also element 3 which I don't want it to do.
__________________
Hightower's Softpolio
Send a message via MSN to Hightower
Hightower is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
jQuery Timer Plugin ETbyrne The Lounge 0 06-14-2009 02:16 PM
jquery wont work for me :( sarmenhb Javascript, AJAX, E4X 2 09-27-2008 08:52 PM
jQuery and firefox checkboxes?? drewbee Javascript, AJAX, E4X 1 08-27-2008 05:54 PM
Cookie issue -jQuery Sam Granger Javascript, AJAX, E4X 0 12-14-2007 01:44 PM


All times are GMT. The time now is 07:16 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design