Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bootstrap Collapse hide onClick

Featured Replies

http://freedomcore.com/saverplaces.co.uk/NEW/

 

In the above site when click the Terms & Conditions or More information on this voucher links just below the Get Voucher button. You will see a div slide down below with the content.

 

I want it so that if you have clicked Terms & Conditions then go and click More information on this voucher it will hide the "Terms & Conditions" content so that both are not displayed at the same time.

 

My JavaScript isn't the best this is what I came up with but it does not work:

 

I have More information on this voucher link this class hide-terms-1 then I have this jQuery code:

$(document).ready(function(){
  $(".hide-terms-1").click(function(){
   $("#voucher-terms-1").hide();
  });
});
 
This seems to be working kind of but once it is click you can not open it back up again.

I don't have your original code, so fill in the blanks where necessary:

$(document).ready(function(){
 $("more-information-click").click(function(){
  $("terms-and-conditions-div").hide();
   $("more-information-div").slideToggle(300);
 });
});

The T&C div will stay hidden while clicking the More Information toggle even if already hidden; it will display when you click the T&C toggle (as already live on your website).

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.