Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Website Design (https://www.warriorforum.com/website-design/)
-   -   Need help with Javascript/jQuery (https://www.warriorforum.com/website-design/454346-need-help-javascript-jquery.html)

Kyle Oliveiro 19th September 2011 11:29 AM

Need help with Javascript/jQuery
 
    

FraserJilani 19th September 2011 12:55 PM

Re: Need help with Javascript/jQuery
 
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 19th September 2011 01:39 PM

Re: Need help with Javascript/jQuery
 
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 19th September 2011 03:43 PM

Re: Need help with Javascript/jQuery
 
Yeah you will need to include the jQuery library.


All times are GMT -6. The time now is 11:22 AM.