Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 19th Sep 2011, 11:29 AM   #1
Active Warrior
War Room Member
 
Join Date: 2011
Posts: 34
Thanks: 31
Thanked 32 Times in 31 Posts
Default
Need help with Javascript/jQuery
Share on: 
fb share twitter share gplus share more share

    

Last edited on 24th Mar 2016 at 06:46 AM. Reason:     
Kyle Oliveiro is offline  
Unread 19th Sep 2011, 12:55 PM   #2
Warrior Member
War Room Member
 
FraserJilani's Avatar
 
Join Date: 2011
Location: Ipswich, England
Posts: 29
Thanks: 0
Thanked 3 Times in 3 Posts
Default
Re: Need help with Javascript/jQuery
Share on: 
fb share twitter share gplus share more share

First I would recommend coding up the HTML of what you require with proper Classes and IDs so you can target the elements with Javascript.

Basically for your first case you would set the hidden div to display:none;

Lets say your hidden div has a class of .hidden and your button has a class of .button. Your code will be something like this:-

Code:
$(function(){
    $('.hidden').css({opacity:0}); //Use jQuery to set the opacity to 0
    $('.button').click(function(){
        $('.hidden').css({display : "block"}).stop(0,0).animate({opacity:1},500);
    });
});
The second one should follow the same principles if I understand your requirements correctly. It would help if you had the HTML code done already .

FraserJilani is offline  
Unread 19th Sep 2011, 01:39 PM   #3
Warrior Member
War Room Member
 
FraserJilani's Avatar
 
Join Date: 2011
Location: Ipswich, England
Posts: 29
Thanks: 0
Thanked 3 Times in 3 Posts
Default
Re: Need help with Javascript/jQuery
Share on: 
fb share twitter share gplus share more share

Dude that's a comment in my code explaining what I am doing with that line. The code is complete I'm not telling you to do anything extra. Perhaps you can link me to the live site and I will put your elements into the code above .

FraserJilani is offline  
Unread 19th Sep 2011, 03:43 PM   #4
Warrior Member
War Room Member
 
FraserJilani's Avatar
 
Join Date: 2011
Location: Ipswich, England
Posts: 29
Thanks: 0
Thanked 3 Times in 3 Posts
Default
Re: Need help with Javascript/jQuery
Share on: 
fb share twitter share gplus share more share

Yeah you will need to include the jQuery library.

FraserJilani is offline  
Closed Thread


Bookmarks

Tags
javascript or jquery


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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:31 AM.