Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Download Button JavaScript Document
- jQuery(document).ready(function() {
- var brochureHeight = jQuery('.brochure_list').height();
- var list1open = false;
- var list2open = false;
- // Hide the dropdown
- jQuery('.brochure_list').height(0).css('display', 'none');
- jQuery('.brochure_list1').height(0).css('display', 'none');
- // Put hand there for hover
- jQuery('.download_brochure').css({cursor: 'pointer'});
- // On click event
- jQuery('.download_brochure').click(function() {
- jQuery(this).css('backgroundPosition','-326px 0');
- var height = brochureHeight;
- if (list1open)
- {
- height = 0;
- list1open = false;
- } else
- {
- list1open = true;
- }
- jQuery('.brochure_list').css('display','block').animate({
- height: height
- }, 350, function() {
- // Animation complete.
- if (!list1open)
- jQuery('.brochure_list').css('display','none');
- });
- return false;
- });
- jQuery('body').click(function(){
- if (list1open)
- {
- jQuery('.brochure_list').animate({
- height: 0
- }, 350, function() {
- // Animation complete.
- jQuery('.brochure_list').css('display', 'none');
- });
- list1open = false;
- jQuery('.download_brochure',this).css('backgroundPosition','0px 0px');
- }
- if (list2open)
- {
- jQuery('.brochure_list1').animate({
- height: 0
- }, 350, function() {
- // Animation complete.
- jQuery('.brochure_list1').css('display', 'none');
- });
- list2open = false;
- }
- });
- // Put hand there for click
- jQuery('.download_brochure1').css({cursor: 'pointer'});
- // On click event
- jQuery('.download_brochure1').click(function() {
- jQuery(this).css('backgroundPosition','-326px 0');
- height = brochureHeight;
- if (list2open)
- {
- height = 0;
- list2open = false;
- jQuery('.download_brochure1',this).css('backgroundPosition','0px 0px');
- } else
- {
- list2open = true;
- }
- jQuery('.brochure_list1').css('display','block').animate({
- height: height
- }, 350, function() {
- // Animation complete.
- if (!list2open)
- jQuery('.brochure_list1').css('display','none');
- });
- return false;
- });
- // Close Doc Ready
- });
Add Comment
Please, Sign In to add comment