Jump to content

jQuery Div Effects

- - - - -

  • Please log in to reply
1 reply to this topic

#1
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 298 posts
  • Location:Australia
  • Programming Language:C, C++, PHP, Python, Delphi/Object Pascal, Assembly
  • Learning:Python, Assembly
Hello all,

I've been adding page data to each page on my website so that users may click a link in the Toolbox (in the sidebar) and view this data.

I'm using PHP to retrieve the constants' values (theirs multiple constants). This is fine, however, I only want the div to be shown if the user clicks the link.

Goto my site's homepage to test it (if you want to). It's Page Data in the sidebar.

Basically, I want to use jQuery to hide the div upon loading, then if the user clicks the link, show the div.


<div id="footer">

<div id="pageData">

<script type="text/javascript" src="http://brezerd.net/jquery.js">

$('#pageData').load(hidepageData ());

hidepageData ()

{

$('#pageData').hide(2,'slow');

}

</script>

<?php

echo ("Page ID: ").constant("pageID");

?>

<br>

<?php

echo ("Page Name: ").constant("pageName");

?>


I've hidden and shown divs before using jQuery, but with event attributes I'm not so sure.

Just to make it clear, the PHP works fine, it's the JavaScript (i.e. jQuery).

Thank you.

Edited by Hunter100, 08 April 2011 - 05:37 PM.
More information required, typo and bad grammar on the last line.

Jack
Creator, Owner, Webmaster
Brezerd.net

#2
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
did you try below
$(function(){$("#divID").hide();});





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users